Split this out from other changes to keep things sane..

wxDeprecated KeyCode.
wxDeprecated old wxList compat methods.
Replaced a large number of them in the gtk build already, but there are
still plenty more so feel free to help nuke them as you find them.
s/^I/    / and s/TRUE/true/ etc. a couple of these too.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ron Lee
2003-01-13 05:17:41 +00:00
parent 5797172366
commit b1d4dd7add
59 changed files with 1099 additions and 996 deletions

View File

@@ -20,6 +20,30 @@ All:
- support wxListCtrl columns alignment for all platforms and not just MSW - support wxListCtrl columns alignment for all platforms and not just MSW
- added wxDateSpan::operator==() and !=() (Lukasz Michalski) - added wxDateSpan::operator==() and !=() (Lukasz Michalski)
- use true/false throughout the library instead of TRUE/FALSE - use true/false throughout the library instead of TRUE/FALSE
- Changed to type-safe wxSizerItemList for wxSizer child items.
Deprecated:
wxSizer::Remove( wxWindow* )
- it does not function as Remove would usually be expected to
and destroy the window, use Detach instead.
wxSizer::GetOption(),
wxSizer::SetOption()
- wxSizer 'option' parameter was renamed 'proportion' to better
reflect its action, use Get/SetProportion instead.
wxKeyEvent::KeyCode()
- use GetKeyCode instead.
wxList:: Number, First, Last, Nth
- use typesafe GetCount, GetFirst, GetLast, Item instead.
wxNode:: Next, Previous, Data
- use typesafe Get* instead.
wxListBase::operator wxList&()
- use typesafe lists instead.
Unix: Unix:

View File

@@ -91,7 +91,7 @@ public:
wxList& GetCommands() const { return (wxList&) m_commands; } wxList& GetCommands() const { return (wxList&) m_commands; }
wxCommand *GetCurrentCommand() const wxCommand *GetCurrentCommand() const
{ {
return (wxCommand *)(m_currentCommand ? m_currentCommand->Data() : NULL); return (wxCommand *)(m_currentCommand ? m_currentCommand->GetData() : NULL);
} }
int GetMaxCommands() const { return m_maxNoCommands; } int GetMaxCommands() const { return m_maxNoCommands; }
virtual void ClearCommands(); virtual void ClearCommands();

View File

@@ -155,10 +155,10 @@ public:
void SetKeyInteger(long i) { m_key.integer = i; } void SetKeyInteger(long i) { m_key.integer = i; }
#ifdef wxLIST_COMPATIBILITY #ifdef wxLIST_COMPATIBILITY
// compatibility methods // compatibility methods, use Get* instead.
wxNode *Next() const { return (wxNode *)GetNext(); } wxDEPRECATED( wxNode *Next() const );
wxNode *Previous() const { return (wxNode *)GetPrevious(); } wxDEPRECATED( wxNode *Previous() const );
wxObject *Data() const { return (wxObject *)GetData(); } wxDEPRECATED( wxObject *Data() const );
#endif // wxLIST_COMPATIBILITY #endif // wxLIST_COMPATIBILITY
protected: protected:
@@ -191,6 +191,8 @@ private:
// a double-linked list class // a double-linked list class
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
class wxList;
class WXDLLEXPORT wxListBase : public wxObject class WXDLLEXPORT wxListBase : public wxObject
{ {
friend class WXDLLEXPORT wxNodeBase; // should be able to call DetachNode() friend class WXDLLEXPORT wxNodeBase; // should be able to call DetachNode()
@@ -232,10 +234,14 @@ public:
{ wxASSERT( m_count==0 ); m_keyType = keyType; } { wxASSERT( m_count==0 ); m_keyType = keyType; }
#ifdef wxLIST_COMPATIBILITY #ifdef wxLIST_COMPATIBILITY
int Number() const { return GetCount(); } // compatibility methods from old wxList
wxNode *First() const { return (wxNode *)GetFirst(); } wxDEPRECATED( int Number() const ); // use GetCount instead.
wxNode *Last() const { return (wxNode *)GetLast(); } wxDEPRECATED( wxNode *First() const ); // use GetFirst
wxNode *Nth(size_t n) const { return (wxNode *)Item(n); } wxDEPRECATED( wxNode *Last() const ); // use GetLast
wxDEPRECATED( wxNode *Nth(size_t n) const ); // use Item
// kludge for typesafe list migration in core classes.
wxDEPRECATED( operator wxList&() const );
#endif // wxLIST_COMPATIBILITY #endif // wxLIST_COMPATIBILITY
protected: protected:
@@ -502,6 +508,9 @@ private:
#ifdef wxLIST_COMPATIBILITY #ifdef wxLIST_COMPATIBILITY
// define this to make a lot of noise about use of the old wxList classes.
//#define wxWARN_COMPAT_LIST_USE
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// wxList compatibility class: in fact, it's a list of wxObjects // wxList compatibility class: in fact, it's a list of wxObjects
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@@ -511,7 +520,12 @@ WX_DECLARE_LIST_2(wxObject, wxObjectList, wxObjectListNode, class WXDLLEXPORT);
class WXDLLEXPORT wxList : public wxObjectList class WXDLLEXPORT wxList : public wxObjectList
{ {
public: public:
wxList(int key_type = wxKEY_NONE) : wxObjectList((wxKeyType)key_type) { } #ifdef wxWARN_COMPAT_LIST_USE
wxDEPRECATED( wxList(int key_type = wxKEY_NONE) );
#else
wxList(int key_type = wxKEY_NONE);
#endif
// this destructor is required for Darwin // this destructor is required for Darwin
~wxList() { } ~wxList() { }
@@ -538,8 +552,13 @@ class WXDLLEXPORT wxStringList : public wxStringListBase
public: public:
// ctors and such // ctors and such
// default // default
wxStringList() { DeleteContents(TRUE); } #ifdef wxWARN_COMPAT_LIST_USE
wxDEPRECATED( wxStringList() );
wxDEPRECATED( wxStringList(const wxChar *first ...) );
#else
wxStringList();
wxStringList(const wxChar *first ...); wxStringList(const wxChar *first ...);
#endif
// copying the string list: the strings are copied, too (extremely // copying the string list: the strings are copied, too (extremely
// inefficient!) // inefficient!)

View File

@@ -383,7 +383,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
void MyCanvas::OnChar( wxKeyEvent &event ) void MyCanvas::OnChar( wxKeyEvent &event )
{ {
switch ( event.KeyCode() ) switch ( event.GetKeyCode() )
{ {
case WXK_LEFT: case WXK_LEFT:
PrevChar(); PrevChar();
@@ -415,9 +415,9 @@ void MyCanvas::OnChar( wxKeyEvent &event )
break; break;
default: default:
if ( !event.AltDown() && wxIsprint(event.KeyCode()) ) if ( !event.AltDown() && wxIsprint(event.GetKeyCode()) )
{ {
wxChar ch = (wxChar)event.KeyCode(); wxChar ch = (wxChar)event.GetKeyCode();
CharAt(m_xCaret, m_yCaret) = ch; CharAt(m_xCaret, m_yCaret) = ch;
wxCaretSuspend cs(this); wxCaretSuspend cs(this);

View File

@@ -1690,7 +1690,7 @@ void MyComboBox::OnChar(wxKeyEvent& event)
{ {
wxLogMessage(_T("MyComboBox::OnChar")); wxLogMessage(_T("MyComboBox::OnChar"));
if ( event.KeyCode() == 'w' ) if ( event.GetKeyCode() == 'w' )
wxLogMessage(_T("MyComboBox: 'w' will be ignored.")); wxLogMessage(_T("MyComboBox: 'w' will be ignored."));
else else
event.Skip(); event.Skip();
@@ -1700,7 +1700,7 @@ void MyComboBox::OnKeyDown(wxKeyEvent& event)
{ {
wxLogMessage(_T("MyComboBox::OnKeyDown")); wxLogMessage(_T("MyComboBox::OnKeyDown"));
if ( event.KeyCode() == 'w' ) if ( event.GetKeyCode() == 'w' )
wxLogMessage(_T("MyComboBox: 'w' will be ignored.")); wxLogMessage(_T("MyComboBox: 'w' will be ignored."));
else else
event.Skip(); event.Skip();

View File

@@ -50,17 +50,17 @@ wxSTD ostream& DrawingDocument::SaveObject(wxSTD ostream& stream)
{ {
wxDocument::SaveObject(stream); wxDocument::SaveObject(stream);
wxInt32 n = doodleSegments.Number(); wxInt32 n = doodleSegments.GetCount();
stream << n << '\n'; stream << n << '\n';
wxNode *node = doodleSegments.First(); wxNode *node = doodleSegments.GetFirst();
while (node) while (node)
{ {
DoodleSegment *segment = (DoodleSegment *)node->Data(); DoodleSegment *segment = (DoodleSegment *)node->GetData();
segment->SaveObject(stream); segment->SaveObject(stream);
stream << '\n'; stream << '\n';
node = node->Next(); node = node->GetNext();
} }
return stream; return stream;
@@ -72,17 +72,17 @@ wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& stream)
wxTextOutputStream text_stream( stream ); wxTextOutputStream text_stream( stream );
wxInt32 n = doodleSegments.Number(); wxInt32 n = doodleSegments.GetCount();
text_stream << n << '\n'; text_stream << n << '\n';
wxNode *node = doodleSegments.First(); wxNode *node = doodleSegments.GetFirst();
while (node) while (node)
{ {
DoodleSegment *segment = (DoodleSegment *)node->Data(); DoodleSegment *segment = (DoodleSegment *)node->GetData();
segment->SaveObject(stream); segment->SaveObject(stream);
text_stream << '\n'; text_stream << '\n';
node = node->Next(); node = node->GetNext();
} }
return stream; return stream;
@@ -133,10 +133,10 @@ DoodleSegment::DoodleSegment(void)
DoodleSegment::DoodleSegment(DoodleSegment& seg) DoodleSegment::DoodleSegment(DoodleSegment& seg)
{ {
wxNode *node = seg.lines.First(); wxNode *node = seg.lines.GetFirst();
while (node) while (node)
{ {
DoodleLine *line = (DoodleLine *)node->Data(); DoodleLine *line = (DoodleLine *)node->GetData();
DoodleLine *newLine = new DoodleLine; DoodleLine *newLine = new DoodleLine;
newLine->x1 = line->x1; newLine->x1 = line->x1;
newLine->y1 = line->y1; newLine->y1 = line->y1;
@@ -145,7 +145,7 @@ DoodleSegment::DoodleSegment(DoodleSegment& seg)
lines.Append(newLine); lines.Append(newLine);
node = node->Next(); node = node->GetNext();
} }
} }
@@ -157,18 +157,18 @@ DoodleSegment::~DoodleSegment(void)
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
wxSTD ostream& DoodleSegment::SaveObject(wxSTD ostream& stream) wxSTD ostream& DoodleSegment::SaveObject(wxSTD ostream& stream)
{ {
wxInt32 n = lines.Number(); wxInt32 n = lines.GetCount();
stream << n << '\n'; stream << n << '\n';
wxNode *node = lines.First(); wxNode *node = lines.GetFirst();
while (node) while (node)
{ {
DoodleLine *line = (DoodleLine *)node->Data(); DoodleLine *line = (DoodleLine *)node->GetData();
stream << line->x1 << " " << stream << line->x1 << " " <<
line->y1 << " " << line->y1 << " " <<
line->x2 << " " << line->x2 << " " <<
line->y2 << "\n"; line->y2 << "\n";
node = node->Next(); node = node->GetNext();
} }
return stream; return stream;
@@ -178,18 +178,18 @@ wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& stream)
{ {
wxTextOutputStream text_stream( stream ); wxTextOutputStream text_stream( stream );
wxInt32 n = lines.Number(); wxInt32 n = lines.GetCount();
text_stream << n << _T('\n'); text_stream << n << _T('\n');
wxNode *node = lines.First(); wxNode *node = lines.GetFirst();
while (node) while (node)
{ {
DoodleLine *line = (DoodleLine *)node->Data(); DoodleLine *line = (DoodleLine *)node->GetData();
text_stream << line->x1 << _T(" ") << text_stream << line->x1 << _T(" ") <<
line->y1 << _T(" ") << line->y1 << _T(" ") <<
line->x2 << _T(" ") << line->x2 << _T(" ") <<
line->y2 << _T("\n"); line->y2 << _T("\n");
node = node->Next(); node = node->GetNext();
} }
return stream; return stream;
@@ -238,12 +238,12 @@ wxInputStream &DoodleSegment::LoadObject(wxInputStream& stream)
void DoodleSegment::Draw(wxDC *dc) void DoodleSegment::Draw(wxDC *dc)
{ {
wxNode *node = lines.First(); wxNode *node = lines.GetFirst();
while (node) while (node)
{ {
DoodleLine *line = (DoodleLine *)node->Data(); DoodleLine *line = (DoodleLine *)node->GetData();
dc->DrawLine(line->x1, line->y1, line->x2, line->y2); dc->DrawLine(line->x1, line->y1, line->x2, line->y2);
node = node->Next(); node = node->GetNext();
} }
} }
@@ -272,13 +272,13 @@ bool DrawingCommand::Do(void)
case DOODLE_CUT: case DOODLE_CUT:
{ {
// Cut the last segment // Cut the last segment
if (doc->GetDoodleSegments().Number() > 0) if (doc->GetDoodleSegments().GetCount() > 0)
{ {
wxNode *node = doc->GetDoodleSegments().Last(); wxNode *node = doc->GetDoodleSegments().GetLast();
if (segment) if (segment)
delete segment; delete segment;
segment = (DoodleSegment *)node->Data(); segment = (DoodleSegment *)node->GetData();
delete node; delete node;
doc->Modify(TRUE); doc->Modify(TRUE);
@@ -318,10 +318,10 @@ bool DrawingCommand::Undo(void)
case DOODLE_ADD: case DOODLE_ADD:
{ {
// Cut the last segment // Cut the last segment
if (doc->GetDoodleSegments().Number() > 0) if (doc->GetDoodleSegments().GetCount() > 0)
{ {
wxNode *node = doc->GetDoodleSegments().Last(); wxNode *node = doc->GetDoodleSegments().GetLast();
DoodleSegment *seg = (DoodleSegment *)node->Data(); DoodleSegment *seg = (DoodleSegment *)node->GetData();
delete seg; delete seg;
delete node; delete node;

View File

@@ -90,12 +90,12 @@ void DrawingView::OnDraw(wxDC *dc)
dc->SetFont(*wxNORMAL_FONT); dc->SetFont(*wxNORMAL_FONT);
dc->SetPen(*wxBLACK_PEN); dc->SetPen(*wxBLACK_PEN);
wxNode *node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().First(); wxNode *node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().GetFirst();
while (node) while (node)
{ {
DoodleSegment *seg = (DoodleSegment *)node->Data(); DoodleSegment *seg = (DoodleSegment *)node->GetData();
seg->Draw(dc); seg->Draw(dc);
node = node->Next(); node = node->GetNext();
} }
} }
@@ -241,7 +241,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
if (currentSegment && event.LeftUp()) if (currentSegment && event.LeftUp())
{ {
if (currentSegment->lines.Number() == 0) if (currentSegment->lines.GetCount() == 0)
{ {
delete currentSegment; delete currentSegment;
currentSegment = (DoodleSegment *) NULL; currentSegment = (DoodleSegment *) NULL;

View File

@@ -48,17 +48,17 @@ wxSTD ostream& DrawingDocument::SaveObject(wxSTD ostream& stream)
{ {
wxDocument::SaveObject(stream); wxDocument::SaveObject(stream);
wxInt32 n = doodleSegments.Number(); wxInt32 n = doodleSegments.GetCount();
stream << n << _T('\n'); stream << n << _T('\n');
wxNode *node = doodleSegments.First(); wxNode *node = doodleSegments.GetFirst();
while (node) while (node)
{ {
DoodleSegment *segment = (DoodleSegment *)node->Data(); DoodleSegment *segment = (DoodleSegment *)node->GetData();
segment->SaveObject(stream); segment->SaveObject(stream);
stream << _T('\n'); stream << _T('\n');
node = node->Next(); node = node->GetNext();
} }
return stream; return stream;
@@ -70,17 +70,17 @@ wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& stream)
wxTextOutputStream text_stream( stream ); wxTextOutputStream text_stream( stream );
wxInt32 n = doodleSegments.Number(); wxInt32 n = doodleSegments.GetCount();
text_stream << n << _T('\n'); text_stream << n << _T('\n');
wxNode *node = doodleSegments.First(); wxNode *node = doodleSegments.GetFirst();
while (node) while (node)
{ {
DoodleSegment *segment = (DoodleSegment *)node->Data(); DoodleSegment *segment = (DoodleSegment *)node->GetData();
segment->SaveObject(stream); segment->SaveObject(stream);
text_stream << _T('\n'); text_stream << _T('\n');
node = node->Next(); node = node->GetNext();
} }
return stream; return stream;
@@ -130,10 +130,10 @@ DoodleSegment::DoodleSegment(void)
DoodleSegment::DoodleSegment(DoodleSegment& seg) DoodleSegment::DoodleSegment(DoodleSegment& seg)
{ {
wxNode *node = seg.lines.First(); wxNode *node = seg.lines.GetFirst();
while (node) while (node)
{ {
DoodleLine *line = (DoodleLine *)node->Data(); DoodleLine *line = (DoodleLine *)node->GetData();
DoodleLine *newLine = new DoodleLine; DoodleLine *newLine = new DoodleLine;
newLine->x1 = line->x1; newLine->x1 = line->x1;
newLine->y1 = line->y1; newLine->y1 = line->y1;
@@ -142,7 +142,7 @@ DoodleSegment::DoodleSegment(DoodleSegment& seg)
lines.Append(newLine); lines.Append(newLine);
node = node->Next(); node = node->GetNext();
} }
} }
@@ -154,18 +154,18 @@ DoodleSegment::~DoodleSegment(void)
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
wxSTD ostream& DoodleSegment::SaveObject(wxSTD ostream& stream) wxSTD ostream& DoodleSegment::SaveObject(wxSTD ostream& stream)
{ {
wxInt32 n = lines.Number(); wxInt32 n = lines.GetCount();
stream << n << _T('\n'); stream << n << _T('\n');
wxNode *node = lines.First(); wxNode *node = lines.GetFirst();
while (node) while (node)
{ {
DoodleLine *line = (DoodleLine *)node->Data(); DoodleLine *line = (DoodleLine *)node->GetData();
stream << line->x1 << _T(" ") << stream << line->x1 << _T(" ") <<
line->y1 << _T(" ") << line->y1 << _T(" ") <<
line->x2 << _T(" ") << line->x2 << _T(" ") <<
line->y2 << _T("\n"); line->y2 << _T("\n");
node = node->Next(); node = node->GetNext();
} }
return stream; return stream;
@@ -175,18 +175,18 @@ wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& stream)
{ {
wxTextOutputStream text_stream( stream ); wxTextOutputStream text_stream( stream );
wxInt32 n = lines.Number(); wxInt32 n = lines.GetCount();
text_stream << n << _T('\n'); text_stream << n << _T('\n');
wxNode *node = lines.First(); wxNode *node = lines.GetFirst();
while (node) while (node)
{ {
DoodleLine *line = (DoodleLine *)node->Data(); DoodleLine *line = (DoodleLine *)node->GetData();
text_stream << line->x1 << _T(" ") << text_stream << line->x1 << _T(" ") <<
line->y1 << _T(" ") << line->y1 << _T(" ") <<
line->x2 << _T(" ") << line->x2 << _T(" ") <<
line->y2 << _T("\n"); line->y2 << _T("\n");
node = node->Next(); node = node->GetNext();
} }
return stream; return stream;
@@ -234,12 +234,12 @@ wxInputStream &DoodleSegment::LoadObject(wxInputStream& stream)
#endif #endif
void DoodleSegment::Draw(wxDC *dc) void DoodleSegment::Draw(wxDC *dc)
{ {
wxNode *node = lines.First(); wxNode *node = lines.GetFirst();
while (node) while (node)
{ {
DoodleLine *line = (DoodleLine *)node->Data(); DoodleLine *line = (DoodleLine *)node->GetData();
dc->DrawLine(line->x1, line->y1, line->x2, line->y2); dc->DrawLine(line->x1, line->y1, line->x2, line->y2);
node = node->Next(); node = node->GetNext();
} }
} }
@@ -268,13 +268,13 @@ bool DrawingCommand::Do(void)
case DOODLE_CUT: case DOODLE_CUT:
{ {
// Cut the last segment // Cut the last segment
if (doc->GetDoodleSegments().Number() > 0) if (doc->GetDoodleSegments().GetCount() > 0)
{ {
wxNode *node = doc->GetDoodleSegments().Last(); wxNode *node = doc->GetDoodleSegments().GetLast();
if (segment) if (segment)
delete segment; delete segment;
segment = (DoodleSegment *)node->Data(); segment = (DoodleSegment *)node->GetData();
delete node; delete node;
doc->Modify(TRUE); doc->Modify(TRUE);
@@ -314,10 +314,10 @@ bool DrawingCommand::Undo(void)
case DOODLE_ADD: case DOODLE_ADD:
{ {
// Cut the last segment // Cut the last segment
if (doc->GetDoodleSegments().Number() > 0) if (doc->GetDoodleSegments().GetCount() > 0)
{ {
wxNode *node = doc->GetDoodleSegments().Last(); wxNode *node = doc->GetDoodleSegments().GetLast();
DoodleSegment *seg = (DoodleSegment *)node->Data(); DoodleSegment *seg = (DoodleSegment *)node->GetData();
delete seg; delete seg;
delete node; delete node;

View File

@@ -69,12 +69,12 @@ void DrawingView::OnDraw(wxDC *dc)
dc->SetFont(*wxNORMAL_FONT); dc->SetFont(*wxNORMAL_FONT);
dc->SetPen(*wxBLACK_PEN); dc->SetPen(*wxBLACK_PEN);
wxNode *node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().First(); wxNode *node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().GetFirst();
while (node) while (node)
{ {
DoodleSegment *seg = (DoodleSegment *)node->Data(); DoodleSegment *seg = (DoodleSegment *)node->GetData();
seg->Draw(dc); seg->Draw(dc);
node = node->Next(); node = node->GetNext();
} }
} }
@@ -220,7 +220,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
if (currentSegment && event.LeftUp()) if (currentSegment && event.LeftUp())
{ {
if (currentSegment->lines.Number() == 0) if (currentSegment->lines.GetCount() == 0)
{ {
delete currentSegment; delete currentSegment;
currentSegment = (DoodleSegment *) NULL; currentSegment = (DoodleSegment *) NULL;

View File

@@ -270,13 +270,13 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
void MyCanvas::DrawShapes(wxDC& dc) void MyCanvas::DrawShapes(wxDC& dc)
{ {
wxNode* node = m_displayList.First(); wxNode* node = m_displayList.GetFirst();
while (node) while (node)
{ {
DragShape* shape = (DragShape*) node->Data(); DragShape* shape = (DragShape*) node->GetData();
if (shape->IsShown()) if (shape->IsShown())
shape->Draw(dc); shape->Draw(dc);
node = node->Next(); node = node->GetNext();
} }
} }
@@ -295,25 +295,25 @@ void MyCanvas::EraseShape(DragShape* shape, wxDC& dc)
void MyCanvas::ClearShapes() void MyCanvas::ClearShapes()
{ {
wxNode* node = m_displayList.First(); wxNode* node = m_displayList.GetFirst();
while (node) while (node)
{ {
DragShape* shape = (DragShape*) node->Data(); DragShape* shape = (DragShape*) node->GetData();
delete shape; delete shape;
node = node->Next(); node = node->GetNext();
} }
m_displayList.Clear(); m_displayList.Clear();
} }
DragShape* MyCanvas::FindShape(const wxPoint& pt) const DragShape* MyCanvas::FindShape(const wxPoint& pt) const
{ {
wxNode* node = m_displayList.First(); wxNode* node = m_displayList.GetFirst();
while (node) while (node)
{ {
DragShape* shape = (DragShape*) node->Data(); DragShape* shape = (DragShape*) node->GetData();
if (shape->HitTest(pt)) if (shape->HitTest(pt))
return shape; return shape;
node = node->Next(); node = node->GetNext();
} }
return (DragShape*) NULL; return (DragShape*) NULL;
} }

View File

@@ -357,7 +357,7 @@ void TestGLCanvas::Action( long code, unsigned long lasttime,
void TestGLCanvas::OnKeyDown( wxKeyEvent& event ) void TestGLCanvas::OnKeyDown( wxKeyEvent& event )
{ {
long evkey = event.KeyCode(); long evkey = event.GetKeyCode();
if (evkey == 0) return; if (evkey == 0) return;
if (!m_TimeInitialized) if (!m_TimeInitialized)

View File

@@ -379,7 +379,7 @@ void TestGLCanvas::OnSize(wxSizeEvent& event)
void TestGLCanvas::OnChar(wxKeyEvent& event) void TestGLCanvas::OnChar(wxKeyEvent& event)
{ {
switch(event.KeyCode()) { switch(event.GetKeyCode()) {
case WXK_ESCAPE: case WXK_ESCAPE:
exit(0); exit(0);
case WXK_LEFT: case WXK_LEFT:

View File

@@ -424,7 +424,7 @@ bool MyTextCtrl::ms_logFocus = FALSE;
void MyTextCtrl::LogKeyEvent(const wxChar *name, wxKeyEvent& event) const void MyTextCtrl::LogKeyEvent(const wxChar *name, wxKeyEvent& event) const
{ {
wxString key; wxString key;
long keycode = event.KeyCode(); long keycode = event.GetKeyCode();
{ {
switch ( keycode ) switch ( keycode )
{ {
@@ -696,7 +696,7 @@ void MyTextCtrl::OnKeyUp(wxKeyEvent& event)
void MyTextCtrl::OnKeyDown(wxKeyEvent& event) void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
{ {
switch ( event.KeyCode() ) switch ( event.GetKeyCode() )
{ {
case WXK_F1: case WXK_F1:
// show current position and text length // show current position and text length

View File

@@ -854,7 +854,7 @@ TREE_EVENT_HANDLER(OnSelChanging)
void LogKeyEvent(const wxChar *name, const wxKeyEvent& event) void LogKeyEvent(const wxChar *name, const wxKeyEvent& event)
{ {
wxString key; wxString key;
long keycode = event.KeyCode(); long keycode = event.GetKeyCode();
{ {
switch ( keycode ) switch ( keycode )
{ {

View File

@@ -212,10 +212,10 @@ void wxAppBase::ProcessPendingEvents()
} }
// iterate until the list becomes empty // iterate until the list becomes empty
wxNode *node = wxPendingEvents->First(); wxNode *node = wxPendingEvents->GetFirst();
while (node) while (node)
{ {
wxEvtHandler *handler = (wxEvtHandler *)node->Data(); wxEvtHandler *handler = (wxEvtHandler *)node->GetData();
delete node; delete node;
// In ProcessPendingEvents(), new handlers might be add // In ProcessPendingEvents(), new handlers might be add
@@ -224,7 +224,7 @@ void wxAppBase::ProcessPendingEvents()
handler->ProcessPendingEvents(); handler->ProcessPendingEvents();
wxENTER_CRIT_SECT( *wxPendingEventsLocker ); wxENTER_CRIT_SECT( *wxPendingEventsLocker );
node = wxPendingEvents->First(); node = wxPendingEvents->GetFirst();
} }
wxLEAVE_CRIT_SECT( *wxPendingEventsLocker ); wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );

View File

@@ -112,10 +112,10 @@ void wxCommandProcessor::Store(wxCommand *command)
{ {
wxCHECK_RET( command, _T("no command in wxCommandProcessor::Store") ); wxCHECK_RET( command, _T("no command in wxCommandProcessor::Store") );
if (m_commands.Number() == m_maxNoCommands) if ( (int)m_commands.GetCount() == m_maxNoCommands )
{ {
wxNode *firstNode = m_commands.First(); wxNode *firstNode = m_commands.GetFirst();
wxCommand *firstCommand = (wxCommand *)firstNode->Data(); wxCommand *firstCommand = (wxCommand *)firstNode->GetData();
delete firstCommand; delete firstCommand;
delete firstNode; delete firstNode;
} }
@@ -126,18 +126,18 @@ void wxCommandProcessor::Store(wxCommand *command)
ClearCommands(); ClearCommands();
else else
{ {
wxNode *node = m_currentCommand->Next(); wxNode *node = m_currentCommand->GetNext();
while (node) while (node)
{ {
wxNode *next = node->Next(); wxNode *next = node->GetNext();
delete (wxCommand *)node->Data(); delete (wxCommand *)node->GetData();
delete node; delete node;
node = next; node = next;
} }
} }
m_commands.Append(command); m_commands.Append(command);
m_currentCommand = m_commands.Last(); m_currentCommand = m_commands.GetLast();
SetMenuStrings(); SetMenuStrings();
} }
@@ -148,7 +148,7 @@ bool wxCommandProcessor::Undo()
{ {
if ( UndoCommand(*command) ) if ( UndoCommand(*command) )
{ {
m_currentCommand = m_currentCommand->Previous(); m_currentCommand = m_currentCommand->GetPrevious();
SetMenuStrings(); SetMenuStrings();
return TRUE; return TRUE;
} }
@@ -165,18 +165,18 @@ bool wxCommandProcessor::Redo()
if ( m_currentCommand ) if ( m_currentCommand )
{ {
// is there anything to redo? // is there anything to redo?
if ( m_currentCommand->Next() ) if ( m_currentCommand->GetNext() )
{ {
redoCommand = (wxCommand *)m_currentCommand->Next()->Data(); redoCommand = (wxCommand *)m_currentCommand->GetNext()->GetData();
redoNode = m_currentCommand->Next(); redoNode = m_currentCommand->GetNext();
} }
} }
else // no current command, redo the first one else // no current command, redo the first one
{ {
if (m_commands.Number() > 0) if (m_commands.GetCount() > 0)
{ {
redoCommand = (wxCommand *)m_commands.First()->Data(); redoCommand = (wxCommand *)m_commands.GetFirst()->GetData();
redoNode = m_commands.First(); redoNode = m_commands.GetFirst();
} }
} }
@@ -202,13 +202,13 @@ bool wxCommandProcessor::CanUndo() const
bool wxCommandProcessor::CanRedo() const bool wxCommandProcessor::CanRedo() const
{ {
if ((m_currentCommand != (wxNode*) NULL) && (m_currentCommand->Next() == (wxNode*) NULL)) if ((m_currentCommand != (wxNode*) NULL) && (m_currentCommand->GetNext() == (wxNode*) NULL))
return FALSE; return FALSE;
if ((m_currentCommand != (wxNode*) NULL) && (m_currentCommand->Next() != (wxNode*) NULL)) if ((m_currentCommand != (wxNode*) NULL) && (m_currentCommand->GetNext() != (wxNode*) NULL))
return TRUE; return TRUE;
if ((m_currentCommand == (wxNode*) NULL) && (m_commands.Number() > 0)) if ((m_currentCommand == (wxNode*) NULL) && (m_commands.GetCount() > 0))
return TRUE; return TRUE;
return FALSE; return FALSE;
@@ -216,7 +216,7 @@ bool wxCommandProcessor::CanRedo() const
void wxCommandProcessor::Initialize() void wxCommandProcessor::Initialize()
{ {
m_currentCommand = m_commands.Last(); m_currentCommand = m_commands.GetLast();
SetMenuStrings(); SetMenuStrings();
} }
@@ -243,7 +243,7 @@ wxString wxCommandProcessor::GetUndoMenuLabel() const
wxString buf; wxString buf;
if (m_currentCommand) if (m_currentCommand)
{ {
wxCommand *command = (wxCommand *)m_currentCommand->Data(); wxCommand *command = (wxCommand *)m_currentCommand->GetData();
wxString commandName(command->GetName()); wxString commandName(command->GetName());
if (commandName == wxT("")) commandName = _("Unnamed command"); if (commandName == wxT("")) commandName = _("Unnamed command");
bool canUndo = command->CanUndo(); bool canUndo = command->CanUndo();
@@ -267,9 +267,9 @@ wxString wxCommandProcessor::GetRedoMenuLabel() const
if (m_currentCommand) if (m_currentCommand)
{ {
// We can redo, if we're not at the end of the history. // We can redo, if we're not at the end of the history.
if (m_currentCommand->Next()) if (m_currentCommand->GetNext())
{ {
wxCommand *redoCommand = (wxCommand *)m_currentCommand->Next()->Data(); wxCommand *redoCommand = (wxCommand *)m_currentCommand->GetNext()->GetData();
wxString redoCommandName(redoCommand->GetName()); wxString redoCommandName(redoCommand->GetName());
if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command"); if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator; buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;
@@ -281,7 +281,7 @@ wxString wxCommandProcessor::GetRedoMenuLabel() const
} }
else else
{ {
if (m_commands.Number() == 0) if (m_commands.GetCount() == 0)
{ {
buf = _("&Redo") + m_redoAccelerator; buf = _("&Redo") + m_redoAccelerator;
} }
@@ -289,7 +289,7 @@ wxString wxCommandProcessor::GetRedoMenuLabel() const
{ {
// currentCommand is NULL but there are commands: this means that // currentCommand is NULL but there are commands: this means that
// we've undone to the start of the list, but can redo the first. // we've undone to the start of the list, but can redo the first.
wxCommand *redoCommand = (wxCommand *)m_commands.First()->Data(); wxCommand *redoCommand = (wxCommand *)m_commands.GetFirst()->GetData();
wxString redoCommandName(redoCommand->GetName()); wxString redoCommandName(redoCommand->GetName());
if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command"); if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator; buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;
@@ -300,13 +300,13 @@ wxString wxCommandProcessor::GetRedoMenuLabel() const
void wxCommandProcessor::ClearCommands() void wxCommandProcessor::ClearCommands()
{ {
wxNode *node = m_commands.First(); wxNode *node = m_commands.GetFirst();
while (node) while (node)
{ {
wxCommand *command = (wxCommand *)node->Data(); wxCommand *command = (wxCommand *)node->GetData();
delete command; delete command;
delete node; delete node;
node = m_commands.First(); node = m_commands.GetFirst();
} }
m_currentCommand = (wxNode *) NULL; m_currentCommand = (wxNode *) NULL;
} }

View File

@@ -69,13 +69,13 @@ void wxDCBase::DoDrawCheckMark(wxCoord x1, wxCoord y1,
void wxDCBase::DrawLines(const wxList *list, wxCoord xoffset, wxCoord yoffset) void wxDCBase::DrawLines(const wxList *list, wxCoord xoffset, wxCoord yoffset)
{ {
int n = list->Number(); int n = list->GetCount();
wxPoint *points = new wxPoint[n]; wxPoint *points = new wxPoint[n];
int i = 0; int i = 0;
for ( wxNode *node = list->First(); node; node = node->Next(), i++ ) for ( wxNode *node = list->GetFirst(); node; node = node->GetNext(), i++ )
{ {
wxPoint *point = (wxPoint *)node->Data(); wxPoint *point = (wxPoint *)node->GetData();
points[i].x = point->x; points[i].x = point->x;
points[i].y = point->y; points[i].y = point->y;
} }
@@ -90,13 +90,13 @@ void wxDCBase::DrawPolygon(const wxList *list,
wxCoord xoffset, wxCoord yoffset, wxCoord xoffset, wxCoord yoffset,
int fillStyle) int fillStyle)
{ {
int n = list->Number(); int n = list->GetCount();
wxPoint *points = new wxPoint[n]; wxPoint *points = new wxPoint[n];
int i = 0; int i = 0;
for ( wxNode *node = list->First(); node; node = node->Next(), i++ ) for ( wxNode *node = list->GetFirst(); node; node = node->GetNext(), i++ )
{ {
wxPoint *point = (wxPoint *)node->Data(); wxPoint *point = (wxPoint *)node->GetData();
points[i].x = point->x; points[i].x = point->x;
points[i].y = point->y; points[i].y = point->y;
} }
@@ -131,9 +131,9 @@ void wxDCBase::DrawSpline(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoor
DrawSpline(&point_list); DrawSpline(&point_list);
for( wxNode *node = point_list.First(); node; node = node->Next() ) for( wxNode *node = point_list.GetFirst(); node; node = node->GetNext() )
{ {
wxPoint *p = (wxPoint *)node->Data(); wxPoint *p = (wxPoint *)node->GetData();
delete p; delete p;
} }
} }
@@ -254,13 +254,13 @@ static bool wx_spline_add_point(double x, double y)
static void wx_spline_draw_point_array(wxDCBase *dc) static void wx_spline_draw_point_array(wxDCBase *dc)
{ {
dc->DrawLines(&wx_spline_point_list, 0, 0 ); dc->DrawLines(&wx_spline_point_list, 0, 0 );
wxNode *node = wx_spline_point_list.First(); wxNode *node = wx_spline_point_list.GetFirst();
while (node) while (node)
{ {
wxPoint *point = (wxPoint *)node->Data(); wxPoint *point = (wxPoint *)node->GetData();
delete point; delete point;
delete node; delete node;
node = wx_spline_point_list.First(); node = wx_spline_point_list.GetFirst();
} }
} }
@@ -272,14 +272,14 @@ void wxDCBase::DoDrawSpline( wxList *points )
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4; double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
double x1, y1, x2, y2; double x1, y1, x2, y2;
wxNode *node = points->First(); wxNode *node = points->GetFirst();
p = (wxPoint *)node->Data(); p = (wxPoint *)node->GetData();
x1 = p->x; x1 = p->x;
y1 = p->y; y1 = p->y;
node = node->Next(); node = node->GetNext();
p = (wxPoint *)node->Data(); p = (wxPoint *)node->GetData();
x2 = p->x; x2 = p->x;
y2 = p->y; y2 = p->y;
@@ -290,9 +290,9 @@ void wxDCBase::DoDrawSpline( wxList *points )
wx_spline_add_point(x1, y1); wx_spline_add_point(x1, y1);
while ((node = node->Next()) != NULL) while ((node = node->GetNext()) != NULL)
{ {
p = (wxPoint *)node->Data(); p = (wxPoint *)node->GetData();
x1 = x2; x1 = x2;
y1 = y2; y1 = y2;
x2 = p->x; x2 = p->x;

View File

@@ -181,14 +181,14 @@ bool wxDocument::DeleteAllViews()
{ {
wxDocManager* manager = GetDocumentManager(); wxDocManager* manager = GetDocumentManager();
wxNode *node = m_documentViews.First(); wxNode *node = m_documentViews.GetFirst();
while (node) while (node)
{ {
wxView *view = (wxView *)node->Data(); wxView *view = (wxView *)node->GetData();
if (!view->Close()) if (!view->Close())
return FALSE; return FALSE;
wxNode *next = node->Next(); wxNode *next = node->GetNext();
delete view; // Deletes node implicitly delete view; // Deletes node implicitly
node = next; node = next;
@@ -203,9 +203,9 @@ bool wxDocument::DeleteAllViews()
wxView *wxDocument::GetFirstView() const wxView *wxDocument::GetFirstView() const
{ {
if (m_documentViews.Number() == 0) if (m_documentViews.GetCount() == 0)
return (wxView *) NULL; return (wxView *) NULL;
return (wxView *)m_documentViews.First()->Data(); return (wxView *)m_documentViews.GetFirst()->GetData();
} }
wxDocManager *wxDocument::GetDocumentManager() const wxDocManager *wxDocument::GetDocumentManager() const
@@ -275,12 +275,12 @@ bool wxDocument::SaveAs()
GetDocumentManager()->AddFileToHistory(fileName); GetDocumentManager()->AddFileToHistory(fileName);
// Notify the views that the filename has changed // Notify the views that the filename has changed
wxNode *node = m_documentViews.First(); wxNode *node = m_documentViews.GetFirst();
while (node) while (node)
{ {
wxView *view = (wxView *)node->Data(); wxView *view = (wxView *)node->GetData();
view->OnChangeFilename(); view->OnChangeFilename();
node = node->Next(); node = node->GetNext();
} }
return OnSaveDocument(m_documentFile); return OnSaveDocument(m_documentFile);
@@ -498,7 +498,7 @@ bool wxDocument::OnCreate(const wxString& WXUNUSED(path), long flags)
// there are no more views. // there are no more views.
void wxDocument::OnChangedViewList() void wxDocument::OnChangedViewList()
{ {
if (m_documentViews.Number() == 0) if (m_documentViews.GetCount() == 0)
{ {
if (OnSaveModified()) if (OnSaveModified())
{ {
@@ -509,24 +509,24 @@ void wxDocument::OnChangedViewList()
void wxDocument::UpdateAllViews(wxView *sender, wxObject *hint) void wxDocument::UpdateAllViews(wxView *sender, wxObject *hint)
{ {
wxNode *node = m_documentViews.First(); wxNode *node = m_documentViews.GetFirst();
while (node) while (node)
{ {
wxView *view = (wxView *)node->Data(); wxView *view = (wxView *)node->GetData();
if (view != sender) if (view != sender)
view->OnUpdate(sender, hint); view->OnUpdate(sender, hint);
node = node->Next(); node = node->GetNext();
} }
} }
void wxDocument::NotifyClosing() void wxDocument::NotifyClosing()
{ {
wxNode *node = m_documentViews.First(); wxNode *node = m_documentViews.GetFirst();
while (node) while (node)
{ {
wxView *view = (wxView *)node->Data(); wxView *view = (wxView *)node->GetData();
view->OnClosingDocument(); view->OnClosingDocument();
node = node->Next(); node = node->GetNext();
} }
} }
@@ -536,12 +536,12 @@ void wxDocument::SetFilename(const wxString& filename, bool notifyViews)
if ( notifyViews ) if ( notifyViews )
{ {
// Notify the views that the filename has changed // Notify the views that the filename has changed
wxNode *node = m_documentViews.First(); wxNode *node = m_documentViews.GetFirst();
while (node) while (node)
{ {
wxView *view = (wxView *)node->Data(); wxView *view = (wxView *)node->GetData();
view->OnChangeFilename(); view->OnChangeFilename();
node = node->Next(); node = node->GetNext();
} }
} }
} }
@@ -774,11 +774,11 @@ wxDocManager::~wxDocManager()
bool wxDocManager::CloseDocuments(bool force) bool wxDocManager::CloseDocuments(bool force)
{ {
wxNode *node = m_docs.First(); wxNode *node = m_docs.GetFirst();
while (node) while (node)
{ {
wxDocument *doc = (wxDocument *)node->Data(); wxDocument *doc = (wxDocument *)node->GetData();
wxNode *next = node->Next(); wxNode *next = node->GetNext();
if (!doc->Close() && !force) if (!doc->Close() && !force)
return FALSE; return FALSE;
@@ -804,11 +804,11 @@ bool wxDocManager::Clear(bool force)
if (!CloseDocuments(force)) if (!CloseDocuments(force))
return FALSE; return FALSE;
wxNode *node = m_templates.First(); wxNode *node = m_templates.GetFirst();
while (node) while (node)
{ {
wxDocTemplate *templ = (wxDocTemplate*) node->Data(); wxDocTemplate *templ = (wxDocTemplate*) node->GetData();
wxNode* next = node->Next(); wxNode* next = node->GetNext();
delete templ; delete templ;
node = next; node = next;
} }
@@ -1029,9 +1029,9 @@ wxView *wxDocManager::GetCurrentView() const
{ {
if (m_currentView) if (m_currentView)
return m_currentView; return m_currentView;
if (m_docs.Number() == 1) if (m_docs.GetCount() == 1)
{ {
wxDocument* doc = (wxDocument*) m_docs.First()->Data(); wxDocument* doc = (wxDocument*) m_docs.GetFirst()->GetData();
return doc->GetFirstView(); return doc->GetFirstView();
} }
return (wxView *) NULL; return (wxView *) NULL;
@@ -1051,12 +1051,12 @@ bool wxDocManager::ProcessEvent(wxEvent& event)
wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags) wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
{ {
wxDocTemplate **templates = new wxDocTemplate *[m_templates.Number()]; wxDocTemplate **templates = new wxDocTemplate *[m_templates.GetCount()];
int i; int n = 0;
int n = 0;
for (i = 0; i < m_templates.Number(); i++) for (size_t i = 0; i < m_templates.GetCount(); i++)
{ {
wxDocTemplate *temp = (wxDocTemplate *)(m_templates.Nth(i)->Data()); wxDocTemplate *temp = (wxDocTemplate *)(m_templates.Item(i)->GetData());
if (temp->IsVisible()) if (temp->IsVisible())
{ {
templates[n] = temp; templates[n] = temp;
@@ -1071,9 +1071,9 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
// If we've reached the max number of docs, close the // If we've reached the max number of docs, close the
// first one. // first one.
if (GetDocuments().Number() >= m_maxDocsOpen) if ( (int)GetDocuments().GetCount() >= m_maxDocsOpen )
{ {
wxDocument *doc = (wxDocument *)GetDocuments().First()->Data(); wxDocument *doc = (wxDocument *)GetDocuments().GetFirst()->GetData();
if (doc->Close()) if (doc->Close())
{ {
// Implicitly deletes the document when // Implicitly deletes the document when
@@ -1162,12 +1162,12 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
wxView *wxDocManager::CreateView(wxDocument *doc, long flags) wxView *wxDocManager::CreateView(wxDocument *doc, long flags)
{ {
wxDocTemplate **templates = new wxDocTemplate *[m_templates.Number()]; wxDocTemplate **templates = new wxDocTemplate *[m_templates.GetCount()];
int n =0; int n =0;
int i;
for (i = 0; i < m_templates.Number(); i++) for (size_t i = 0; i < m_templates.GetCount(); i++)
{ {
wxDocTemplate *temp = (wxDocTemplate *)(m_templates.Nth(i)->Data()); wxDocTemplate *temp = (wxDocTemplate *)(m_templates.Item(i)->GetData());
if (temp->IsVisible()) if (temp->IsVisible())
{ {
if (temp->GetDocumentName() == doc->GetDocumentName()) if (temp->GetDocumentName() == doc->GetDocumentName())
@@ -1335,10 +1335,9 @@ wxDocTemplate *wxDocManager::FindTemplateForPath(const wxString& path)
wxDocTemplate *theTemplate = (wxDocTemplate *) NULL; wxDocTemplate *theTemplate = (wxDocTemplate *) NULL;
// Find the template which this extension corresponds to // Find the template which this extension corresponds to
int i; for (size_t i = 0; i < m_templates.GetCount(); i++)
for (i = 0; i < m_templates.Number(); i++)
{ {
wxDocTemplate *temp = (wxDocTemplate *)m_templates.Nth(i)->Data(); wxDocTemplate *temp = (wxDocTemplate *)m_templates.Item(i)->GetData();
if ( temp->FileMatchesTemplate(path) ) if ( temp->FileMatchesTemplate(path) )
{ {
theTemplate = temp; theTemplate = temp;
@@ -1951,14 +1950,14 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
// Move existing files (if any) down so we can insert file at beginning. // Move existing files (if any) down so we can insert file at beginning.
if (m_fileHistoryN < m_fileMaxFiles) if (m_fileHistoryN < m_fileMaxFiles)
{ {
wxNode* node = m_fileMenus.First(); wxNode* node = m_fileMenus.GetFirst();
while (node) while (node)
{ {
wxMenu* menu = (wxMenu*) node->Data(); wxMenu* menu = (wxMenu*) node->GetData();
if (m_fileHistoryN == 0) if (m_fileHistoryN == 0)
menu->AppendSeparator(); menu->AppendSeparator();
menu->Append(wxID_FILE1+m_fileHistoryN, _("[EMPTY]")); menu->Append(wxID_FILE1+m_fileHistoryN, _("[EMPTY]"));
node = node->Next(); node = node->GetNext();
} }
m_fileHistoryN ++; m_fileHistoryN ++;
} }
@@ -1994,12 +1993,12 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
wxString buf; wxString buf;
buf.Printf(s_MRUEntryFormat, i + 1, pathInMenu.c_str()); buf.Printf(s_MRUEntryFormat, i + 1, pathInMenu.c_str());
wxNode* node = m_fileMenus.First(); wxNode* node = m_fileMenus.GetFirst();
while (node) while (node)
{ {
wxMenu* menu = (wxMenu*) node->Data(); wxMenu* menu = (wxMenu*) node->GetData();
menu->SetLabel(wxID_FILE1 + i, buf); menu->SetLabel(wxID_FILE1 + i, buf);
node = node->Next(); node = node->GetNext();
} }
} }
} }
@@ -2019,10 +2018,10 @@ void wxFileHistory::RemoveFileFromHistory(int i)
m_fileHistory[j] = m_fileHistory[j + 1]; m_fileHistory[j] = m_fileHistory[j + 1];
} }
wxNode* node = m_fileMenus.First(); wxNode* node = m_fileMenus.GetFirst();
while ( node ) while ( node )
{ {
wxMenu* menu = (wxMenu*) node->Data(); wxMenu* menu = (wxMenu*) node->GetData();
// shuffle filenames up // shuffle filenames up
@@ -2033,7 +2032,7 @@ void wxFileHistory::RemoveFileFromHistory(int i)
menu->SetLabel(wxID_FILE1 + j, buf); menu->SetLabel(wxID_FILE1 + j, buf);
} }
node = node->Next(); node = node->GetNext();
// delete the last menu item which is unused now // delete the last menu item which is unused now
if (menu->FindItem(wxID_FILE1 + m_fileHistoryN - 1)) if (menu->FindItem(wxID_FILE1 + m_fileHistoryN - 1))
@@ -2118,10 +2117,10 @@ void wxFileHistory::AddFilesToMenu()
{ {
if (m_fileHistoryN > 0) if (m_fileHistoryN > 0)
{ {
wxNode* node = m_fileMenus.First(); wxNode* node = m_fileMenus.GetFirst();
while (node) while (node)
{ {
wxMenu* menu = (wxMenu*) node->Data(); wxMenu* menu = (wxMenu*) node->GetData();
menu->AppendSeparator(); menu->AppendSeparator();
int i; int i;
for (i = 0; i < m_fileHistoryN; i++) for (i = 0; i < m_fileHistoryN; i++)
@@ -2133,7 +2132,7 @@ void wxFileHistory::AddFilesToMenu()
menu->Append(wxID_FILE1+i, buf); menu->Append(wxID_FILE1+i, buf);
} }
} }
node = node->Next(); node = node->GetNext();
} }
} }
} }

View File

@@ -633,19 +633,19 @@ wxEvtHandler::~wxEvtHandler()
if (m_dynamicEvents) if (m_dynamicEvents)
{ {
wxNode *node = m_dynamicEvents->First(); wxNode *node = m_dynamicEvents->GetFirst();
while (node) while (node)
{ {
#if WXWIN_COMPATIBILITY_EVENT_TYPES #if WXWIN_COMPATIBILITY_EVENT_TYPES
wxEventTableEntry *entry = (wxEventTableEntry*)node->Data(); wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData();
#else // !WXWIN_COMPATIBILITY_EVENT_TYPES #else // !WXWIN_COMPATIBILITY_EVENT_TYPES
wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->Data(); wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES #endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
if (entry->m_callbackUserData) if (entry->m_callbackUserData)
delete entry->m_callbackUserData; delete entry->m_callbackUserData;
delete entry; delete entry;
node = node->Next(); node = node->GetNext();
} }
delete m_dynamicEvents; delete m_dynamicEvents;
}; };
@@ -730,10 +730,10 @@ void wxEvtHandler::ProcessPendingEvents()
wxENTER_CRIT_SECT( *m_eventsLocker); wxENTER_CRIT_SECT( *m_eventsLocker);
#endif #endif
wxNode *node = m_pendingEvents->First(); wxNode *node = m_pendingEvents->GetFirst();
while ( node ) while ( node )
{ {
wxEvent *event = (wxEvent *)node->Data(); wxEvent *event = (wxEvent *)node->GetData();
delete node; delete node;
// In ProcessEvent, new events might get added and // In ProcessEvent, new events might get added and
@@ -751,7 +751,7 @@ void wxEvtHandler::ProcessPendingEvents()
wxENTER_CRIT_SECT( *m_eventsLocker); wxENTER_CRIT_SECT( *m_eventsLocker);
#endif #endif
node = m_pendingEvents->First(); node = m_pendingEvents->GetFirst();
} }
#if defined(__VISAGECPP__) #if defined(__VISAGECPP__)
@@ -996,13 +996,13 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
if (!m_dynamicEvents) if (!m_dynamicEvents)
return FALSE; return FALSE;
wxNode *node = m_dynamicEvents->First(); wxNode *node = m_dynamicEvents->GetFirst();
while (node) while (node)
{ {
#if WXWIN_COMPATIBILITY_EVENT_TYPES #if WXWIN_COMPATIBILITY_EVENT_TYPES
wxEventTableEntry *entry = (wxEventTableEntry*)node->Data(); wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData();
#else // !WXWIN_COMPATIBILITY_EVENT_TYPES #else // !WXWIN_COMPATIBILITY_EVENT_TYPES
wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->Data(); wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES #endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
if ((entry->m_id == id) && if ((entry->m_id == id) &&
@@ -1017,7 +1017,7 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
delete entry; delete entry;
return TRUE; return TRUE;
} }
node = node->Next(); node = node->GetNext();
} }
return FALSE; return FALSE;
} }
@@ -1029,13 +1029,13 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
int commandId = event.GetId(); int commandId = event.GetId();
wxNode *node = m_dynamicEvents->First(); wxNode *node = m_dynamicEvents->GetFirst();
while (node) while (node)
{ {
#if WXWIN_COMPATIBILITY_EVENT_TYPES #if WXWIN_COMPATIBILITY_EVENT_TYPES
wxEventTableEntry *entry = (wxEventTableEntry*)node->Data(); wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData();
#else // !WXWIN_COMPATIBILITY_EVENT_TYPES #else // !WXWIN_COMPATIBILITY_EVENT_TYPES
wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->Data(); wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES #endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
if (entry->m_fn) if (entry->m_fn)
@@ -1058,7 +1058,7 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
return TRUE; return TRUE;
} }
} }
node = node->Next(); node = node->GetNext();
} }
return FALSE; return FALSE;
}; };

View File

@@ -260,9 +260,9 @@ void wxPathList::EnsureFileAccessible (const wxString& path)
bool wxPathList::Member (const wxString& path) bool wxPathList::Member (const wxString& path)
{ {
for (wxNode * node = First (); node != NULL; node = node->Next ()) for (wxStringList::Node *node = GetFirst(); node; node = node->GetNext())
{ {
wxString path2((wxChar *) node->Data ()); wxString path2( node->GetData() );
if ( if (
#if defined(__WINDOWS__) || defined(__VMS__) || defined (__WXMAC__) #if defined(__WINDOWS__) || defined(__VMS__) || defined (__WXMAC__)
// Case INDEPENDENT // Case INDEPENDENT
@@ -272,9 +272,9 @@ bool wxPathList::Member (const wxString& path)
path.CompareTo (path2) == 0 path.CompareTo (path2) == 0
#endif #endif
) )
return TRUE; return true;
} }
return FALSE; return false;
} }
wxString wxPathList::FindValidPath (const wxString& file) wxString wxPathList::FindValidPath (const wxString& file)
@@ -288,9 +288,9 @@ wxString wxPathList::FindValidPath (const wxString& file)
wxChar *filename = (wxChar*) NULL; /* shut up buggy egcs warning */ wxChar *filename = (wxChar*) NULL; /* shut up buggy egcs warning */
filename = wxIsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (wxChar *)buf; filename = wxIsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (wxChar *)buf;
for (wxNode * node = First (); node; node = node->Next ()) for (wxStringList::Node *node = GetFirst(); node; node = node->GetNext())
{ {
wxChar *path = (wxChar *) node->Data (); wxChar *path = node->GetData();
wxStrcpy (wxFileFunctionsBuffer, path); wxStrcpy (wxFileFunctionsBuffer, path);
wxChar ch = wxFileFunctionsBuffer[wxStrlen(wxFileFunctionsBuffer)-1]; wxChar ch = wxFileFunctionsBuffer[wxStrlen(wxFileFunctionsBuffer)-1];
if (ch != wxT('\\') && ch != wxT('/')) if (ch != wxT('\\') && ch != wxT('/'))
@@ -305,7 +305,7 @@ wxString wxPathList::FindValidPath (const wxString& file)
} }
} // for() } // for()
return wxString(wxT("")); // Not found return wxEmptyString; // Not found
} }
wxString wxPathList::FindAbsoluteValidPath (const wxString& file) wxString wxPathList::FindAbsoluteValidPath (const wxString& file)
@@ -354,23 +354,23 @@ wxIsAbsolutePath (const wxString& filename)
// "MacOS:MyText.txt" is absolute whereas "MyDir:MyText.txt" // "MacOS:MyText.txt" is absolute whereas "MyDir:MyText.txt"
// is not. Or maybe ":MyDir:MyText.txt" has to be used? RR. // is not. Or maybe ":MyDir:MyText.txt" has to be used? RR.
if (filename.Find(':') != wxNOT_FOUND && filename[0] != ':') if (filename.Find(':') != wxNOT_FOUND && filename[0] != ':')
return TRUE ; return true ;
#else #else
// Unix like or Windows // Unix like or Windows
if (filename[0] == wxT('/')) if (filename[0] == wxT('/'))
return TRUE; return true;
#endif #endif
#ifdef __VMS__ #ifdef __VMS__
if ((filename[0] == wxT('[') && filename[1] != wxT('.'))) if ((filename[0] == wxT('[') && filename[1] != wxT('.')))
return TRUE; return true;
#endif #endif
#ifdef __WINDOWS__ #ifdef __WINDOWS__
// MSDOS like // MSDOS like
if (filename[0] == wxT('\\') || (wxIsalpha (filename[0]) && filename[1] == wxT(':'))) if (filename[0] == wxT('\\') || (wxIsalpha (filename[0]) && filename[1] == wxT(':')))
return TRUE; return true;
#endif #endif
} }
return FALSE ; return false ;
} }
/* /*
@@ -549,7 +549,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
s = nm; s = nm;
d = lnm; d = lnm;
#ifdef __WXMSW__ #ifdef __WXMSW__
q = FALSE; q = false;
#else #else
q = nm[0] == wxT('\\') && nm[1] == wxT('~'); q = nm[0] == wxT('\\') && nm[1] == wxT('~');
#endif #endif
@@ -865,8 +865,8 @@ wxString wxMacFSSpec2MacFilename( const FSSpec *spec )
int j; int j;
OSErr theErr; OSErr theErr;
OSStatus theStatus; OSStatus theStatus;
Boolean isDirectory = false; Boolean isDirectory = false;
Str255 theParentPath = "\p"; Str255 theParentPath = "\p";
FSSpec theParentSpec; FSSpec theParentSpec;
FSRef theParentRef; FSRef theParentRef;
char theFileName[FILENAME_MAX]; char theFileName[FILENAME_MAX];
@@ -944,7 +944,7 @@ static char sMacFileNameConversion[ 1000 ] ;
#endif #endif
void wxMacFilename2FSSpec( const char *path , FSSpec *spec ) void wxMacFilename2FSSpec( const char *path , FSSpec *spec )
{ {
OSStatus err = noErr ; OSStatus err = noErr ;
#ifdef __DARWIN__ #ifdef __DARWIN__
FSRef theRef; FSRef theRef;
@@ -953,9 +953,9 @@ void wxMacFilename2FSSpec( const char *path , FSSpec *spec )
// convert the FSRef to an FSSpec // convert the FSRef to an FSSpec
err = FSGetCatalogInfo(&theRef, kFSCatInfoNone, NULL, NULL, spec, NULL); err = FSGetCatalogInfo(&theRef, kFSCatInfoNone, NULL, NULL, spec, NULL);
#else #else
if ( strchr( path , ':' ) == NULL ) if ( strchr( path , ':' ) == NULL )
{ {
// try whether it is a volume / or a mounted volume // try whether it is a volume / or a mounted volume
strncpy( sMacFileNameConversion , path , 1000 ) ; strncpy( sMacFileNameConversion , path , 1000 ) ;
sMacFileNameConversion[998] = 0 ; sMacFileNameConversion[998] = 0 ;
strcat( sMacFileNameConversion , ":" ) ; strcat( sMacFileNameConversion , ":" ) ;
@@ -963,7 +963,7 @@ void wxMacFilename2FSSpec( const char *path , FSSpec *spec )
} }
else else
{ {
err = FSpLocationFromFullPath( strlen(path) , path , spec ) ; err = FSpLocationFromFullPath( strlen(path) , path , spec ) ;
} }
#endif #endif
} }
@@ -1088,7 +1088,7 @@ wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& fil
{ {
wxString outfile; wxString outfile;
if ( !wxGetTempFileName( wxT("cat"), outfile) ) if ( !wxGetTempFileName( wxT("cat"), outfile) )
return FALSE; return false;
FILE *fp1 = (FILE *) NULL; FILE *fp1 = (FILE *) NULL;
FILE *fp2 = (FILE *) NULL; FILE *fp2 = (FILE *) NULL;
@@ -1104,7 +1104,7 @@ wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& fil
fclose (fp2); fclose (fp2);
if (fp3) if (fp3)
fclose (fp3); fclose (fp3);
return FALSE; return false;
} }
int ch; int ch;
@@ -1135,11 +1135,11 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
wxLogSysError(_("Failed to copy the file '%s' to '%s'"), wxLogSysError(_("Failed to copy the file '%s' to '%s'"),
file1.c_str(), file2.c_str()); file1.c_str(), file2.c_str());
return FALSE; return false;
} }
#elif defined(__WXPM__) #elif defined(__WXPM__)
if ( ::DosCopy(file2, file2, overwrite ? DCPY_EXISTING : 0) != 0 ) if ( ::DosCopy(file2, file2, overwrite ? DCPY_EXISTING : 0) != 0 )
return FALSE; return false;
#else // !Win32 #else // !Win32
wxStructStat fbuf; wxStructStat fbuf;
@@ -1150,13 +1150,13 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
// from it anyhow // from it anyhow
wxLogSysError(_("Impossible to get permissions for file '%s'"), wxLogSysError(_("Impossible to get permissions for file '%s'"),
file1.c_str()); file1.c_str());
return FALSE; return false;
} }
// open file1 for reading // open file1 for reading
wxFile fileIn(file1, wxFile::read); wxFile fileIn(file1, wxFile::read);
if ( !fileIn.IsOpened() ) if ( !fileIn.IsOpened() )
return FALSE; return false;
// remove file2, if it exists. This is needed for creating // remove file2, if it exists. This is needed for creating
// file2 with the correct permissions in the next step // file2 with the correct permissions in the next step
@@ -1164,7 +1164,7 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
{ {
wxLogSysError(_("Impossible to overwrite the file '%s'"), wxLogSysError(_("Impossible to overwrite the file '%s'"),
file2.c_str()); file2.c_str());
return FALSE; return false;
} }
#ifdef __UNIX__ #ifdef __UNIX__
@@ -1178,7 +1178,7 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
wxFile fileOut; wxFile fileOut;
if ( !fileOut.Create(file2, overwrite, fbuf.st_mode & 0777) ) if ( !fileOut.Create(file2, overwrite, fbuf.st_mode & 0777) )
return FALSE; return false;
#ifdef __UNIX__ #ifdef __UNIX__
/// restore the old umask /// restore the old umask
@@ -1192,21 +1192,21 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
{ {
count = fileIn.Read(buf, WXSIZEOF(buf)); count = fileIn.Read(buf, WXSIZEOF(buf));
if ( fileIn.Error() ) if ( fileIn.Error() )
return FALSE; return false;
// end of file? // end of file?
if ( !count ) if ( !count )
break; break;
if ( fileOut.Write(buf, count) < count ) if ( fileOut.Write(buf, count) < count )
return FALSE; return false;
} }
// we can expect fileIn to be closed successfully, but we should ensure // we can expect fileIn to be closed successfully, but we should ensure
// that fileOut was closed as some write errors (disk full) might not be // that fileOut was closed as some write errors (disk full) might not be
// detected before doing this // detected before doing this
if ( !fileIn.Close() || !fileOut.Close() ) if ( !fileIn.Close() || !fileOut.Close() )
return FALSE; return false;
#if !defined(__VISAGECPP__) && !defined(__WXMAC__) || defined(__UNIX__) #if !defined(__VISAGECPP__) && !defined(__WXMAC__) || defined(__UNIX__)
// no chmod in VA. Should be some permission API for HPFS386 partitions // no chmod in VA. Should be some permission API for HPFS386 partitions
@@ -1215,12 +1215,12 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
{ {
wxLogSysError(_("Impossible to set permissions for the file '%s'"), wxLogSysError(_("Impossible to set permissions for the file '%s'"),
file2.c_str()); file2.c_str());
return FALSE; return false;
} }
#endif // OS/2 || Mac #endif // OS/2 || Mac
#endif // __WXMSW__ && __WIN32__ #endif // __WXMSW__ && __WIN32__
return TRUE; return true;
} }
bool bool
@@ -1228,15 +1228,15 @@ wxRenameFile (const wxString& file1, const wxString& file2)
{ {
// Normal system call // Normal system call
if ( wxRename (file1, file2) == 0 ) if ( wxRename (file1, file2) == 0 )
return TRUE; return true;
// Try to copy // Try to copy
if (wxCopyFile(file1, file2)) { if (wxCopyFile(file1, file2)) {
wxRemoveFile(file1); wxRemoveFile(file1);
return TRUE; return true;
} }
// Give up // Give up
return FALSE; return false;
} }
bool wxRemoveFile(const wxString& file) bool wxRemoveFile(const wxString& file)
@@ -1282,23 +1282,23 @@ bool wxMkdir(const wxString& dir, int perm)
{ {
wxLogSysError(_("Directory '%s' couldn't be created"), dirname); wxLogSysError(_("Directory '%s' couldn't be created"), dirname);
return FALSE; return false;
} }
return TRUE; return true;
#endif // Mac/!Mac #endif // Mac/!Mac
} }
bool wxRmdir(const wxString& dir, int WXUNUSED(flags)) bool wxRmdir(const wxString& dir, int WXUNUSED(flags))
{ {
#ifdef __VMS__ #ifdef __VMS__
return FALSE; //to be changed since rmdir exists in VMS7.x return false; //to be changed since rmdir exists in VMS7.x
#elif defined(__WXPM__) #elif defined(__WXPM__)
return (::DosDeleteDir((PSZ)dir.c_str()) == 0); return (::DosDeleteDir((PSZ)dir.c_str()) == 0);
#else #else
#ifdef __SALFORDC__ #ifdef __SALFORDC__
return FALSE; // What to do? return false; // What to do?
#else #else
return (wxRmDir(OS_FILENAME(dir)) == 0); return (wxRmDir(OS_FILENAME(dir)) == 0);
#endif #endif
@@ -1434,14 +1434,14 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
buf = new wxChar[sz + 1]; buf = new wxChar[sz + 1];
} }
bool ok = FALSE; bool ok = false;
// for the compilers which have Unicode version of _getcwd(), call it // for the compilers which have Unicode version of _getcwd(), call it
// directly, for the others call the ANSI version and do the translation // directly, for the others call the ANSI version and do the translation
#if !wxUSE_UNICODE #if !wxUSE_UNICODE
#define cbuf buf #define cbuf buf
#else // wxUSE_UNICODE #else // wxUSE_UNICODE
bool needsANSI = TRUE; bool needsANSI = true;
#if !defined(HAVE_WGETCWD) || wxUSE_UNICODE_MSLU #if !defined(HAVE_WGETCWD) || wxUSE_UNICODE_MSLU
// This is not legal code as the compiler // This is not legal code as the compiler
@@ -1455,11 +1455,11 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
#if wxUSE_UNICODE_MSLU #if wxUSE_UNICODE_MSLU
if ( wxGetOsVersion() != wxWIN95 ) if ( wxGetOsVersion() != wxWIN95 )
#else #else
char *cbuf = NULL; // never really used because needsANSI will always be FALSE char *cbuf = NULL; // never really used because needsANSI will always be false
#endif #endif
{ {
ok = _wgetcwd(buf, sz) != NULL; ok = _wgetcwd(buf, sz) != NULL;
needsANSI = FALSE; needsANSI = false;
} }
#endif #endif
@@ -1488,11 +1488,11 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
strcpy( cbuf , res ) ; strcpy( cbuf , res ) ;
cbuf[res.length()]=0 ; cbuf[res.length()]=0 ;
ok = TRUE; ok = true;
} }
else else
{ {
ok = FALSE; ok = false;
} }
#elif defined(__VISAGECPP__) || (defined (__OS2__) && defined (__WATCOMC__)) #elif defined(__VISAGECPP__) || (defined (__OS2__) && defined (__WATCOMC__))
APIRET rc; APIRET rc;
@@ -1620,7 +1620,7 @@ bool wxEndsWithPathSeparator(const wxChar *pszFileName)
bool wxFindFileInPath(wxString *pStr, const wxChar *pszPath, const wxChar *pszFile) bool wxFindFileInPath(wxString *pStr, const wxChar *pszPath, const wxChar *pszFile)
{ {
// we assume that it's not empty // we assume that it's not empty
wxCHECK_MSG( !wxIsEmpty(pszFile), FALSE, wxCHECK_MSG( !wxIsEmpty(pszFile), false,
_T("empty file name in wxFindFileInPath")); _T("empty file name in wxFindFileInPath"));
// skip path separator in the beginning of the file name if present // skip path separator in the beginning of the file name if present
@@ -1691,13 +1691,13 @@ bool wxIsWild( const wxString& pattern )
switch (*pat++) switch (*pat++)
{ {
case wxT('?'): case wxT('*'): case wxT('['): case wxT('{'): case wxT('?'): case wxT('*'): case wxT('['): case wxT('{'):
return TRUE; return true;
case wxT('\\'): case wxT('\\'):
if (!*pat++) if (!*pat++)
return FALSE; return false;
} }
} }
return FALSE; return false;
} }
/* /*
@@ -1729,7 +1729,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
{ {
/* Never match so that hidden Unix files /* Never match so that hidden Unix files
* are never found. */ * are never found. */
return FALSE; return false;
} }
for (;;) for (;;)
@@ -1746,7 +1746,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
{ {
m++; m++;
if (!*n++) if (!*n++)
return FALSE; return false;
} }
else else
{ {
@@ -1755,7 +1755,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
m++; m++;
/* Quoting "nothing" is a bad thing */ /* Quoting "nothing" is a bad thing */
if (!*m) if (!*m)
return FALSE; return false;
} }
if (!*m) if (!*m)
{ {
@@ -1765,9 +1765,9 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
* match * match
*/ */
if (!*n) if (!*n)
return TRUE; return true;
if (just) if (just)
return TRUE; return true;
just = 0; just = 0;
goto not_matched; goto not_matched;
} }
@@ -1799,7 +1799,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
* impossible to match it * impossible to match it
*/ */
if (!*n) if (!*n)
return FALSE; return false;
if (mp) if (mp)
{ {
m = mp; m = mp;
@@ -1821,7 +1821,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
count = acount; count = acount;
} }
else else
return FALSE; return false;
} }
} }
} }

View File

@@ -193,11 +193,11 @@ wxColourDatabase::wxColourDatabase (int type) : wxList (type)
wxColourDatabase::~wxColourDatabase () wxColourDatabase::~wxColourDatabase ()
{ {
// Cleanup Colour allocated in Initialize() // Cleanup Colour allocated in Initialize()
wxNode *node = First (); wxNode *node = GetFirst ();
while (node) while (node)
{ {
wxColour *col = (wxColour *) node->Data (); wxColour *col = (wxColour *) node->GetData ();
wxNode *next = node->Next (); wxNode *next = node->GetNext ();
delete col; delete col;
node = next; node = next;
} }
@@ -330,16 +330,16 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour)
if ( !colName2.Replace(_T("GRAY"), _T("GREY")) ) if ( !colName2.Replace(_T("GRAY"), _T("GREY")) )
colName2.clear(); colName2.clear();
wxNode *node = First(); wxNode *node = GetFirst();
while ( node ) while ( node )
{ {
const wxChar *key = node->GetKeyString(); const wxChar *key = node->GetKeyString();
if ( colName == key || colName2 == key ) if ( colName == key || colName2 == key )
{ {
return (wxColour *)node->Data(); return (wxColour *)node->GetData();
} }
node = node->Next(); node = node->GetNext();
} }
#ifdef __WXMSW__ #ifdef __WXMSW__
@@ -411,9 +411,9 @@ wxString wxColourDatabase::FindName (const wxColour& colour) const
unsigned char green = colour.Green (); unsigned char green = colour.Green ();
unsigned char blue = colour.Blue (); unsigned char blue = colour.Blue ();
for (wxNode * node = First (); node; node = node->Next ()) for (wxNode * node = GetFirst (); node; node = node->GetNext ())
{ {
wxColour *col = (wxColour *) node->Data (); wxColour *col = (wxColour *) node->GetData ();
if (col->Red () == red && col->Green () == green && col->Blue () == blue) if (col->Red () == red && col->Green () == green && col->Blue () == blue)
{ {
@@ -588,11 +588,11 @@ wxBitmapList::wxBitmapList()
wxBitmapList::~wxBitmapList () wxBitmapList::~wxBitmapList ()
{ {
wxNode *node = First (); wxNode *node = GetFirst ();
while (node) while (node)
{ {
wxBitmap *bitmap = (wxBitmap *) node->Data (); wxBitmap *bitmap = (wxBitmap *) node->GetData ();
wxNode *next = node->Next (); wxNode *next = node->GetNext ();
if (bitmap->GetVisible()) if (bitmap->GetVisible())
delete bitmap; delete bitmap;
node = next; node = next;
@@ -602,11 +602,11 @@ wxBitmapList::~wxBitmapList ()
// Pen and Brush lists // Pen and Brush lists
wxPenList::~wxPenList () wxPenList::~wxPenList ()
{ {
wxNode *node = First (); wxNode *node = GetFirst ();
while (node) while (node)
{ {
wxPen *pen = (wxPen *) node->Data (); wxPen *pen = (wxPen *) node->GetData ();
wxNode *next = node->Next (); wxNode *next = node->GetNext ();
if (pen->GetVisible()) if (pen->GetVisible())
delete pen; delete pen;
node = next; node = next;
@@ -625,9 +625,9 @@ void wxPenList::RemovePen (wxPen * pen)
wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, int style) wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, int style)
{ {
for (wxNode * node = First (); node; node = node->Next ()) for (wxNode * node = GetFirst (); node; node = node->GetNext ())
{ {
wxPen *each_pen = (wxPen *) node->Data (); wxPen *each_pen = (wxPen *) node->GetData ();
if (each_pen && if (each_pen &&
each_pen->GetVisible() && each_pen->GetVisible() &&
each_pen->GetWidth () == width && each_pen->GetWidth () == width &&
@@ -657,11 +657,11 @@ wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, int style)
wxBrushList::~wxBrushList () wxBrushList::~wxBrushList ()
{ {
wxNode *node = First (); wxNode *node = GetFirst ();
while (node) while (node)
{ {
wxBrush *brush = (wxBrush *) node->Data (); wxBrush *brush = (wxBrush *) node->GetData ();
wxNode *next = node->Next (); wxNode *next = node->GetNext ();
if (brush && brush->GetVisible()) if (brush && brush->GetVisible())
delete brush; delete brush;
node = next; node = next;
@@ -675,9 +675,9 @@ void wxBrushList::AddBrush (wxBrush * brush)
wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, int style) wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, int style)
{ {
for (wxNode * node = First (); node; node = node->Next ()) for (wxNode * node = GetFirst (); node; node = node->GetNext ())
{ {
wxBrush *each_brush = (wxBrush *) node->Data (); wxBrush *each_brush = (wxBrush *) node->GetData ();
if (each_brush && if (each_brush &&
each_brush->GetVisible() && each_brush->GetVisible() &&
each_brush->GetStyle () == style && each_brush->GetStyle () == style &&
@@ -712,15 +712,15 @@ void wxBrushList::RemoveBrush (wxBrush * brush)
wxFontList::~wxFontList () wxFontList::~wxFontList ()
{ {
wxNode *node = First (); wxNode *node = GetFirst ();
while (node) while (node)
{ {
// Only delete objects that are 'visible', i.e. // Only delete objects that are 'visible', i.e.
// that have been created using FindOrCreate..., // that have been created using FindOrCreate...,
// where the pointers are expected to be shared // where the pointers are expected to be shared
// (and therefore not deleted by any one part of an app). // (and therefore not deleted by any one part of an app).
wxFont *font = (wxFont *) node->Data (); wxFont *font = (wxFont *) node->GetData ();
wxNode *next = node->Next (); wxNode *next = node->GetNext ();
if (font->GetVisible()) if (font->GetVisible())
delete font; delete font;
node = next; node = next;
@@ -747,9 +747,9 @@ wxFont *wxFontList::FindOrCreateFont(int pointSize,
{ {
wxFont *font = (wxFont *)NULL; wxFont *font = (wxFont *)NULL;
wxNode *node; wxNode *node;
for ( node = First(); node; node = node->Next() ) for ( node = GetFirst(); node; node = node->GetNext() )
{ {
font = (wxFont *)node->Data(); font = (wxFont *)node->GetData();
if ( font->GetVisible() && if ( font->GetVisible() &&
font->Ok() && font->Ok() &&
font->GetPointSize () == pointSize && font->GetPointSize () == pointSize &&
@@ -844,12 +844,12 @@ wxSize wxGetDisplaySizeMM()
wxResourceCache::~wxResourceCache () wxResourceCache::~wxResourceCache ()
{ {
wxNode *node = First (); wxNode *node = GetFirst ();
while (node) { while (node) {
wxObject *item = (wxObject *)node->Data(); wxObject *item = (wxObject *)node->GetData();
delete item; delete item;
node = node->Next (); node = node->GetNext ();
} }
} }

View File

@@ -493,7 +493,7 @@ wxObject *wxHashTable::Get (long key, long value) const
{ {
wxNode *node = hash_table[position]->Find (value); wxNode *node = hash_table[position]->Find (value);
if (node) if (node)
return node->Data (); return node->GetData ();
else else
return (wxObject *) NULL; return (wxObject *) NULL;
} }
@@ -513,7 +513,7 @@ wxObject *wxHashTable::Get (long key, const wxChar *value) const
{ {
wxNode *node = hash_table[position]->Find (value); wxNode *node = hash_table[position]->Find (value);
if (node) if (node)
return node->Data (); return node->GetData ();
else else
return (wxObject *) NULL; return (wxObject *) NULL;
} }
@@ -532,7 +532,7 @@ wxObject *wxHashTable::Get (long key) const
else else
{ {
wxNode *node = hash_table[position]->Find (k); wxNode *node = hash_table[position]->Find (k);
return node ? node->Data () : (wxObject*)NULL; return node ? node->GetData () : (wxObject*)NULL;
} }
} }
@@ -546,7 +546,7 @@ wxObject *wxHashTable::Get (const wxChar *key) const
else else
{ {
wxNode *node = hash_table[position]->Find (key); wxNode *node = hash_table[position]->Find (key);
return node ? node->Data () : (wxObject*)NULL; return node ? node->GetData () : (wxObject*)NULL;
} }
} }
@@ -565,7 +565,7 @@ wxObject *wxHashTable::Delete (long key)
wxNode *node = hash_table[position]->Find (k); wxNode *node = hash_table[position]->Find (k);
if (node) if (node)
{ {
wxObject *data = node->Data (); wxObject *data = node->GetData ();
delete node; delete node;
m_count--; m_count--;
return data; return data;
@@ -587,7 +587,7 @@ wxObject *wxHashTable::Delete (const wxChar *key)
wxNode *node = hash_table[position]->Find (key); wxNode *node = hash_table[position]->Find (key);
if (node) if (node)
{ {
wxObject *data = node->Data (); wxObject *data = node->GetData ();
delete node; delete node;
m_count--; m_count--;
return data; return data;
@@ -612,7 +612,7 @@ wxObject *wxHashTable::Delete (long key, int value)
wxNode *node = hash_table[position]->Find (value); wxNode *node = hash_table[position]->Find (value);
if (node) if (node)
{ {
wxObject *data = node->Data (); wxObject *data = node->GetData ();
delete node; delete node;
m_count--; m_count--;
return data; return data;
@@ -634,7 +634,7 @@ wxObject *wxHashTable::Delete (long key, const wxChar *value)
wxNode *node = hash_table[position]->Find (value); wxNode *node = hash_table[position]->Find (value);
if (node) if (node)
{ {
wxObject *data = node->Data (); wxObject *data = node->GetData ();
delete node; delete node;
m_count--; m_count--;
return data; return data;
@@ -679,14 +679,14 @@ wxNode *wxHashTable::Next ()
{ {
if (hash_table[current_position]) if (hash_table[current_position])
{ {
current_node = hash_table[current_position]->First (); current_node = hash_table[current_position]->GetFirst ();
found = current_node; found = current_node;
} }
} }
} }
else else
{ {
current_node = current_node->Next (); current_node = current_node->GetNext ();
found = current_node; found = current_node;
} }
} }

View File

@@ -58,13 +58,13 @@ wxHTTP::~wxHTTP()
void wxHTTP::ClearHeaders() void wxHTTP::ClearHeaders()
{ {
// wxString isn't a wxObject // wxString isn't a wxObject
wxNode *node = m_headers.First(); wxNode *node = m_headers.GetFirst();
wxString *string; wxString *string;
while (node) { while (node) {
string = (wxString *)node->Data(); string = (wxString *)node->GetData();
delete string; delete string;
node = node->Next(); node = node->GetNext();
} }
m_headers.Clear(); m_headers.Clear();
@@ -92,7 +92,7 @@ void wxHTTP::SetHeader(const wxString& header, const wxString& h_data)
if (!node) if (!node)
m_headers.Append(header, (wxObject *)(new wxString(h_data))); m_headers.Append(header, (wxObject *)(new wxString(h_data)));
else { else {
wxString *str = (wxString *)node->Data(); wxString *str = (wxString *)node->GetData();
(*str) = h_data; (*str) = h_data;
} }
} }
@@ -108,16 +108,16 @@ wxString wxHTTP::GetHeader(const wxString& header)
if (!node) if (!node)
return wxEmptyString; return wxEmptyString;
return *((wxString *)node->Data()); return *((wxString *)node->GetData());
} }
void wxHTTP::SendHeaders() void wxHTTP::SendHeaders()
{ {
wxNode *head = m_headers.First(); wxNode *head = m_headers.GetFirst();
while (head) while (head)
{ {
wxString *str = (wxString *)head->Data(); wxString *str = (wxString *)head->GetData();
wxString buf; wxString buf;
buf.Printf(wxT("%s: %s\r\n"), head->GetKeyString(), str->GetData()); buf.Printf(wxT("%s: %s\r\n"), head->GetKeyString(), str->GetData());
@@ -125,7 +125,7 @@ void wxHTTP::SendHeaders()
const wxWX2MBbuf cbuf = buf.mb_str(); const wxWX2MBbuf cbuf = buf.mb_str();
Write(cbuf, strlen(cbuf)); Write(cbuf, strlen(cbuf));
head = head->Next(); head = head->GetNext();
} }
} }

View File

@@ -1213,51 +1213,51 @@ bool wxImage::RemoveHandler( const wxString& name )
wxImageHandler *wxImage::FindHandler( const wxString& name ) wxImageHandler *wxImage::FindHandler( const wxString& name )
{ {
wxNode *node = sm_handlers.First(); wxNode *node = sm_handlers.GetFirst();
while (node) while (node)
{ {
wxImageHandler *handler = (wxImageHandler*)node->Data(); wxImageHandler *handler = (wxImageHandler*)node->GetData();
if (handler->GetName().Cmp(name) == 0) return handler; if (handler->GetName().Cmp(name) == 0) return handler;
node = node->Next(); node = node->GetNext();
} }
return 0; return 0;
} }
wxImageHandler *wxImage::FindHandler( const wxString& extension, long bitmapType ) wxImageHandler *wxImage::FindHandler( const wxString& extension, long bitmapType )
{ {
wxNode *node = sm_handlers.First(); wxNode *node = sm_handlers.GetFirst();
while (node) while (node)
{ {
wxImageHandler *handler = (wxImageHandler*)node->Data(); wxImageHandler *handler = (wxImageHandler*)node->GetData();
if ( (handler->GetExtension().Cmp(extension) == 0) && if ( (handler->GetExtension().Cmp(extension) == 0) &&
(bitmapType == -1 || handler->GetType() == bitmapType) ) (bitmapType == -1 || handler->GetType() == bitmapType) )
return handler; return handler;
node = node->Next(); node = node->GetNext();
} }
return 0; return 0;
} }
wxImageHandler *wxImage::FindHandler( long bitmapType ) wxImageHandler *wxImage::FindHandler( long bitmapType )
{ {
wxNode *node = sm_handlers.First(); wxNode *node = sm_handlers.GetFirst();
while (node) while (node)
{ {
wxImageHandler *handler = (wxImageHandler *)node->Data(); wxImageHandler *handler = (wxImageHandler *)node->GetData();
if (handler->GetType() == bitmapType) return handler; if (handler->GetType() == bitmapType) return handler;
node = node->Next(); node = node->GetNext();
} }
return 0; return 0;
} }
wxImageHandler *wxImage::FindHandlerMime( const wxString& mimetype ) wxImageHandler *wxImage::FindHandlerMime( const wxString& mimetype )
{ {
wxNode *node = sm_handlers.First(); wxNode *node = sm_handlers.GetFirst();
while (node) while (node)
{ {
wxImageHandler *handler = (wxImageHandler *)node->Data(); wxImageHandler *handler = (wxImageHandler *)node->GetData();
if (handler->GetMimeType().IsSameAs(mimetype, FALSE)) return handler; if (handler->GetMimeType().IsSameAs(mimetype, FALSE)) return handler;
node = node->Next(); node = node->GetNext();
} }
return 0; return 0;
} }
@@ -1271,11 +1271,11 @@ void wxImage::InitStandardHandlers()
void wxImage::CleanUpHandlers() void wxImage::CleanUpHandlers()
{ {
wxNode *node = sm_handlers.First(); wxNode *node = sm_handlers.GetFirst();
while (node) while (node)
{ {
wxImageHandler *handler = (wxImageHandler *)node->Data(); wxImageHandler *handler = (wxImageHandler *)node->GetData();
wxNode *next = node->Next(); wxNode *next = node->GetNext();
delete handler; delete handler;
delete node; delete node;
node = next; node = next;

View File

@@ -513,9 +513,9 @@ void wxListBase::Sort(const wxSortCompareFunction compfunc)
// go through the list and put the pointers into the array // go through the list and put the pointers into the array
wxNodeBase *node; wxNodeBase *node;
for ( node = GetFirst(); node; node = node->Next() ) for ( node = GetFirst(); node; node = node->GetNext() )
{ {
*objPtr++ = node->Data(); *objPtr++ = node->GetData();
} }
// sort the array // sort the array
@@ -523,7 +523,7 @@ void wxListBase::Sort(const wxSortCompareFunction compfunc)
// put the sorted pointers back into the list // put the sorted pointers back into the list
objPtr = objArray; objPtr = objArray;
for ( node = GetFirst(); node; node = node->Next() ) for ( node = GetFirst(); node; node = node->GetNext() )
{ {
node->SetData(*objPtr++); node->SetData(*objPtr++);
} }
@@ -538,12 +538,35 @@ void wxListBase::Sort(const wxSortCompareFunction compfunc)
#ifdef wxLIST_COMPATIBILITY #ifdef wxLIST_COMPATIBILITY
// -----------------------------------------------------------------------------
// wxNodeBase deprecated methods
// -----------------------------------------------------------------------------
wxNode *wxNodeBase::Next() const { return (wxNode *)GetNext(); }
wxNode *wxNodeBase::Previous() const { return (wxNode *)GetPrevious(); }
wxObject *wxNodeBase::Data() const { return (wxObject *)GetData(); }
// -----------------------------------------------------------------------------
// wxListBase deprecated methods
// -----------------------------------------------------------------------------
int wxListBase::Number() const { return GetCount(); }
wxNode *wxListBase::First() const { return (wxNode *)GetFirst(); }
wxNode *wxListBase::Last() const { return (wxNode *)GetLast(); }
wxNode *wxListBase::Nth(size_t n) const { return (wxNode *)Item(n); }
wxListBase::operator wxList&() const { return *(wxList*)this; }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// wxList (a.k.a. wxObjectList) // wxList (a.k.a. wxObjectList)
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxList, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxList, wxObject)
wxList::wxList( int key_type )
: wxObjectList( (wxKeyType)key_type )
{
}
void wxObjectListNode::DeleteData() void wxObjectListNode::DeleteData()
{ {
delete (wxObject *)GetData(); delete (wxObject *)GetData();
@@ -590,6 +613,11 @@ void wxStringList::DoCopy(const wxStringList& other)
} }
} }
wxStringList::wxStringList()
{
DeleteContents(TRUE);
}
// Variable argument list, terminated by a zero // Variable argument list, terminated by a zero
// Makes new storage for the strings // Makes new storage for the strings
wxStringList::wxStringList (const wxChar *first, ...) wxStringList::wxStringList (const wxChar *first, ...)

View File

@@ -58,7 +58,7 @@ void wxModule::RegisterModules()
node = wxClassInfo::sm_classTable->Next(); node = wxClassInfo::sm_classTable->Next();
while (node) while (node)
{ {
classInfo = (wxClassInfo *)node->Data(); classInfo = (wxClassInfo *)node->GetData();
if ( classInfo->IsKindOf(CLASSINFO(wxModule)) && if ( classInfo->IsKindOf(CLASSINFO(wxModule)) &&
(classInfo != (& (wxModule::sm_classwxModule))) ) (classInfo != (& (wxModule::sm_classwxModule))) )
{ {

View File

@@ -192,46 +192,46 @@ wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const wxString& name)
{ {
wxNode *node = Find(name); wxNode *node = Find(name);
if (node) if (node)
return (wxPrintPaperType *)node->Data(); return (wxPrintPaperType *)node->GetData();
else else
return (wxPrintPaperType *) NULL; return (wxPrintPaperType *) NULL;
} }
wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(wxPaperSize id) wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(wxPaperSize id)
{ {
wxNode *node = First(); wxNode *node = GetFirst();
while (node) while (node)
{ {
wxPrintPaperType* paperType = (wxPrintPaperType*) node->Data(); wxPrintPaperType* paperType = (wxPrintPaperType*) node->GetData();
if (paperType->GetId() == id) if (paperType->GetId() == id)
return paperType; return paperType;
node = node->Next(); node = node->GetNext();
} }
return (wxPrintPaperType *) NULL; return (wxPrintPaperType *) NULL;
} }
wxPrintPaperType *wxPrintPaperDatabase::FindPaperTypeByPlatformId(int id) wxPrintPaperType *wxPrintPaperDatabase::FindPaperTypeByPlatformId(int id)
{ {
wxNode *node = First(); wxNode *node = GetFirst();
while (node) while (node)
{ {
wxPrintPaperType* paperType = (wxPrintPaperType*) node->Data(); wxPrintPaperType* paperType = (wxPrintPaperType*) node->GetData();
if (paperType->GetPlatformId() == id) if (paperType->GetPlatformId() == id)
return paperType; return paperType;
node = node->Next(); node = node->GetNext();
} }
return (wxPrintPaperType *) NULL; return (wxPrintPaperType *) NULL;
} }
wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const wxSize& sz) wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const wxSize& sz)
{ {
wxNode *node = First(); wxNode *node = GetFirst();
while (node) while (node)
{ {
wxPrintPaperType* paperType = (wxPrintPaperType*) node->Data(); wxPrintPaperType* paperType = (wxPrintPaperType*) node->GetData();
if (paperType->GetSize() == sz) if (paperType->GetSize() == sz)
return paperType; return paperType;
node = node->Next(); node = node->GetNext();
} }
return (wxPrintPaperType *) NULL; return (wxPrintPaperType *) NULL;
} }

View File

@@ -834,11 +834,11 @@ void wxSocketBase::RestoreState()
wxNode *node; wxNode *node;
wxSocketState *state; wxSocketState *state;
node = m_states.Last(); node = m_states.GetLast();
if (!node) if (!node)
return; return;
state = (wxSocketState *)node->Data(); state = (wxSocketState *)node->GetData();
m_flags = state->m_flags; m_flags = state->m_flags;
m_notify = state->m_notify; m_notify = state->m_notify;

View File

@@ -431,10 +431,10 @@ wxWindow* wxFindWindowAtPoint(wxWindow* win, const wxPoint& pt)
if (frame->GetToolBar()) if (frame->GetToolBar())
extraChildren.Append(frame->GetToolBar()); extraChildren.Append(frame->GetToolBar());
wxNode* node = extraChildren.First(); wxNode* node = extraChildren.GetFirst();
while (node) while (node)
{ {
wxWindow* child = (wxWindow*) node->Data(); wxWindow* child = (wxWindow*) node->GetData();
wxWindow* foundWin = wxFindWindowAtPoint(child, pt); wxWindow* foundWin = wxFindWindowAtPoint(child, pt);
if (foundWin) if (foundWin)
return foundWin; return foundWin;
@@ -443,14 +443,14 @@ wxWindow* wxFindWindowAtPoint(wxWindow* win, const wxPoint& pt)
} }
*/ */
wxNode* node = win->GetChildren().Last(); wxWindowList::Node *node = win->GetChildren().GetLast();
while (node) while (node)
{ {
wxWindow* child = (wxWindow*) node->Data(); wxWindow* child = node->GetData();
wxWindow* foundWin = wxFindWindowAtPoint(child, pt); wxWindow* foundWin = wxFindWindowAtPoint(child, pt);
if (foundWin) if (foundWin)
return foundWin; return foundWin;
node = node->Previous(); node = node->GetPrevious();
} }
wxPoint pos = win->GetPosition(); wxPoint pos = win->GetPosition();
@@ -472,14 +472,14 @@ wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt)
// Go backwards through the list since windows // Go backwards through the list since windows
// on top are likely to have been appended most // on top are likely to have been appended most
// recently. // recently.
wxNode* node = wxTopLevelWindows.Last(); wxWindowList::Node *node = wxTopLevelWindows.GetLast();
while (node) while (node)
{ {
wxWindow* win = (wxWindow*) node->Data(); wxWindow* win = node->GetData();
wxWindow* found = wxFindWindowAtPoint(win, pt); wxWindow* found = wxFindWindowAtPoint(win, pt);
if (found) if (found)
return found; return found;
node = node->Previous(); node = node->GetPrevious();
} }
return NULL; return NULL;
} }

View File

@@ -73,21 +73,21 @@ bool wxTextValidator::Copy(const wxTextValidator& val)
m_validatorStyle = val.m_validatorStyle ; m_validatorStyle = val.m_validatorStyle ;
m_stringValue = val.m_stringValue ; m_stringValue = val.m_stringValue ;
wxNode *node = val.m_includeList.First() ; wxStringList::Node *node = val.m_includeList.GetFirst() ;
while ( node ) while ( node )
{ {
wxChar *s = (wxChar *)node->Data(); wxChar *s = node->GetData();
m_includeList.Add(s); m_includeList.Add(s);
node = node->Next(); node = node->GetNext();
} }
node = val.m_excludeList.First() ; node = val.m_excludeList.GetFirst() ;
while ( node ) while ( node )
{ {
wxChar *s = (wxChar *)node->Data(); wxChar *s = node->GetData();
m_excludeList.Add(s); m_excludeList.Add(s);
node = node->Next(); node = node->GetNext();
} }
return TRUE; return true;
} }
wxTextValidator::~wxTextValidator() wxTextValidator::~wxTextValidator()
@@ -100,9 +100,9 @@ static bool wxIsAlpha(const wxString& val)
for ( i = 0; i < (int)val.Length(); i++) for ( i = 0; i < (int)val.Length(); i++)
{ {
if (!wxIsalpha(val[i])) if (!wxIsalpha(val[i]))
return FALSE; return false;
} }
return TRUE; return true;
} }
static bool wxIsAlphaNumeric(const wxString& val) static bool wxIsAlphaNumeric(const wxString& val)
@@ -111,9 +111,9 @@ static bool wxIsAlphaNumeric(const wxString& val)
for ( i = 0; i < (int)val.Length(); i++) for ( i = 0; i < (int)val.Length(); i++)
{ {
if (!wxIsalnum(val[i])) if (!wxIsalnum(val[i]))
return FALSE; return false;
} }
return TRUE; return true;
} }
// Called when the value in the window must be validated. // Called when the value in the window must be validated.
@@ -121,17 +121,17 @@ static bool wxIsAlphaNumeric(const wxString& val)
bool wxTextValidator::Validate(wxWindow *parent) bool wxTextValidator::Validate(wxWindow *parent)
{ {
if( !CheckValidator() ) if( !CheckValidator() )
return FALSE; return false;
wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ; wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ;
// If window is disabled, simply return // If window is disabled, simply return
if ( !control->IsEnabled() ) if ( !control->IsEnabled() )
return TRUE; return true;
wxString val(control->GetValue()); wxString val(control->GetValue());
bool ok = TRUE; bool ok = true;
// NB: this format string should contian exactly one '%s' // NB: this format string should contian exactly one '%s'
wxString errormsg; wxString errormsg;
@@ -149,25 +149,25 @@ bool wxTextValidator::Validate(wxWindow *parent)
} }
else if ( (m_validatorStyle & wxFILTER_ASCII) && !val.IsAscii() ) else if ( (m_validatorStyle & wxFILTER_ASCII) && !val.IsAscii() )
{ {
ok = FALSE; ok = false;
errormsg = _("'%s' should only contain ASCII characters."); errormsg = _("'%s' should only contain ASCII characters.");
} }
else if ( (m_validatorStyle & wxFILTER_ALPHA) && !wxIsAlpha(val) ) else if ( (m_validatorStyle & wxFILTER_ALPHA) && !wxIsAlpha(val) )
{ {
ok = FALSE; ok = false;
errormsg = _("'%s' should only contain alphabetic characters."); errormsg = _("'%s' should only contain alphabetic characters.");
} }
else if ( (m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsAlphaNumeric(val)) else if ( (m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsAlphaNumeric(val))
{ {
ok = FALSE; ok = false;
errormsg = _("'%s' should only contain alphabetic or numeric characters."); errormsg = _("'%s' should only contain alphabetic or numeric characters.");
} }
else if ( (m_validatorStyle & wxFILTER_NUMERIC) && !wxIsNumeric(val)) else if ( (m_validatorStyle & wxFILTER_NUMERIC) && !wxIsNumeric(val))
{ {
ok = FALSE; ok = false;
errormsg = _("'%s' should be numeric."); errormsg = _("'%s' should be numeric.");
} }
@@ -175,13 +175,13 @@ bool wxTextValidator::Validate(wxWindow *parent)
{ {
//it's only ok to have the members of the list //it's only ok to have the members of the list
errormsg = _("'%s' is invalid"); errormsg = _("'%s' is invalid");
ok = FALSE; ok = false;
} }
else if ( (m_validatorStyle & wxFILTER_EXCLUDE_CHAR_LIST) && !IsNotInCharExcludeList(val)) else if ( (m_validatorStyle & wxFILTER_EXCLUDE_CHAR_LIST) && !IsNotInCharExcludeList(val))
{ {
// it's only ok to have non-members of the list // it's only ok to have non-members of the list
errormsg = _("'%s' is invalid"); errormsg = _("'%s' is invalid");
ok = FALSE; ok = false;
} }
if ( !ok ) if ( !ok )
@@ -204,24 +204,24 @@ bool wxTextValidator::Validate(wxWindow *parent)
bool wxTextValidator::TransferToWindow(void) bool wxTextValidator::TransferToWindow(void)
{ {
if( !CheckValidator() ) if( !CheckValidator() )
return FALSE; return false;
wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ; wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ;
control->SetValue(* m_stringValue) ; control->SetValue(* m_stringValue) ;
return TRUE; return true;
} }
// Called to transfer data to the window // Called to transfer data to the window
bool wxTextValidator::TransferFromWindow(void) bool wxTextValidator::TransferFromWindow(void)
{ {
if( !CheckValidator() ) if( !CheckValidator() )
return FALSE; return false;
wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ; wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ;
* m_stringValue = control->GetValue() ; * m_stringValue = control->GetValue() ;
return TRUE; return true;
} }
void wxTextValidator::SetIncludeList(const wxStringList& list) void wxTextValidator::SetIncludeList(const wxStringList& list)
@@ -233,12 +233,12 @@ void wxTextValidator::SetIncludeList(const wxStringList& list)
m_includeList.Clear(); m_includeList.Clear();
// TODO: replace with = // TODO: replace with =
wxNode *node = list.First() ; wxStringList::Node *node = list.GetFirst();
while ( node ) while ( node )
{ {
wxChar *s = (wxChar *)node->Data(); wxChar *s = node->GetData();
m_includeList.Add(s); m_includeList.Add(s);
node = node->Next(); node = node->GetNext();
} }
} }
@@ -251,12 +251,12 @@ void wxTextValidator::SetExcludeList(const wxStringList& list)
m_excludeList.Clear(); m_excludeList.Clear();
// TODO: replace with = // TODO: replace with =
wxNode *node = list.First() ; wxStringList::Node *node = list.GetFirst() ;
while ( node ) while ( node )
{ {
wxChar *s = (wxChar *)node->Data(); wxChar *s = node->GetData();
m_excludeList.Add(s); m_excludeList.Add(s);
node = node->Next(); node = node->GetNext();
} }
} }
@@ -275,7 +275,7 @@ void wxTextValidator::OnChar(wxKeyEvent& event)
if ( if (
!(keyCode < WXK_SPACE || keyCode == WXK_DELETE || keyCode > WXK_START) && !(keyCode < WXK_SPACE || keyCode == WXK_DELETE || keyCode > WXK_START) &&
( (
((m_validatorStyle & wxFILTER_INCLUDE_CHAR_LIST) && !IsInCharIncludeList(wxString((char) keyCode, 1))) || ((m_validatorStyle & wxFILTER_INCLUDE_CHAR_LIST) && !IsInCharIncludeList(wxString((char) keyCode, 1))) ||
((m_validatorStyle & wxFILTER_EXCLUDE_CHAR_LIST) && !IsNotInCharExcludeList(wxString((char) keyCode, 1))) || ((m_validatorStyle & wxFILTER_EXCLUDE_CHAR_LIST) && !IsNotInCharExcludeList(wxString((char) keyCode, 1))) ||
((m_validatorStyle & wxFILTER_ASCII) && !isascii(keyCode)) || ((m_validatorStyle & wxFILTER_ASCII) && !isascii(keyCode)) ||
((m_validatorStyle & wxFILTER_ALPHA) && !wxIsalpha(keyCode)) || ((m_validatorStyle & wxFILTER_ALPHA) && !wxIsalpha(keyCode)) ||
@@ -305,9 +305,9 @@ static bool wxIsNumeric(const wxString& val)
// use wxSystemSettings or other to do better localisation // use wxSystemSettings or other to do better localisation
if ((!isdigit(val[i])) && (val[i] != '.') && (val[i] != ',')) if ((!isdigit(val[i])) && (val[i] != '.') && (val[i] != ','))
if(!((i == 0) && (val[i] == '-'))) if(!((i == 0) && (val[i] == '-')))
return FALSE; return false;
} }
return TRUE; return true;
} }
bool wxTextValidator::IsInCharIncludeList(const wxString& val) bool wxTextValidator::IsInCharIncludeList(const wxString& val)
@@ -316,9 +316,9 @@ bool wxTextValidator::IsInCharIncludeList(const wxString& val)
for ( i = 0; i < val.Length(); i++) for ( i = 0; i < val.Length(); i++)
{ {
if (!m_includeList.Member((wxString) val[i])) if (!m_includeList.Member((wxString) val[i]))
return FALSE; return false;
} }
return TRUE; return true;
} }
bool wxTextValidator::IsNotInCharExcludeList(const wxString& val) bool wxTextValidator::IsNotInCharExcludeList(const wxString& val)
@@ -327,9 +327,9 @@ bool wxTextValidator::IsNotInCharExcludeList(const wxString& val)
for ( i = 0; i < val.Length(); i++) for ( i = 0; i < val.Length(); i++)
{ {
if (m_excludeList.Member((wxString) val[i])) if (m_excludeList.Member((wxString) val[i]))
return FALSE; return false;
} }
return TRUE; return true;
} }
#endif #endif

View File

@@ -101,23 +101,23 @@ wxVariantDataList::~wxVariantDataList()
void wxVariantDataList::SetValue(const wxList& value) void wxVariantDataList::SetValue(const wxList& value)
{ {
Clear(); Clear();
wxNode* node = value.First(); wxNode* node = value.GetFirst();
while (node) while (node)
{ {
wxVariant* var = (wxVariant*) node->Data(); wxVariant* var = (wxVariant*) node->GetData();
m_value.Append(new wxVariant(*var)); m_value.Append(new wxVariant(*var));
node = node->Next(); node = node->GetNext();
} }
} }
void wxVariantDataList::Clear() void wxVariantDataList::Clear()
{ {
wxNode* node = m_value.First(); wxNode* node = m_value.GetFirst();
while (node) while (node)
{ {
wxVariant* var = (wxVariant*) node->Data(); wxVariant* var = (wxVariant*) node->GetData();
delete var; delete var;
node = node->Next(); node = node->GetNext();
} }
m_value.Clear(); m_value.Clear();
} }
@@ -129,12 +129,12 @@ void wxVariantDataList::Copy(wxVariantData& data)
wxVariantDataList& listData = (wxVariantDataList&) data; wxVariantDataList& listData = (wxVariantDataList&) data;
listData.Clear(); listData.Clear();
wxNode* node = m_value.First(); wxNode* node = m_value.GetFirst();
while (node) while (node)
{ {
wxVariant* var = (wxVariant*) node->Data(); wxVariant* var = (wxVariant*) node->GetData();
listData.m_value.Append(new wxVariant(*var)); listData.m_value.Append(new wxVariant(*var));
node = node->Next(); node = node->GetNext();
} }
} }
@@ -143,19 +143,19 @@ bool wxVariantDataList::Eq(wxVariantData& data) const
wxASSERT_MSG( (data.GetType() == wxT("list")), wxT("wxVariantDataList::Eq: argument mismatch") ); wxASSERT_MSG( (data.GetType() == wxT("list")), wxT("wxVariantDataList::Eq: argument mismatch") );
wxVariantDataList& listData = (wxVariantDataList&) data; wxVariantDataList& listData = (wxVariantDataList&) data;
wxNode* node1 = m_value.First(); wxNode* node1 = m_value.GetFirst();
wxNode* node2 = listData.GetValue().First(); wxNode* node2 = listData.GetValue().GetFirst();
while (node1 && node2) while (node1 && node2)
{ {
wxVariant* var1 = (wxVariant*) node1->Data(); wxVariant* var1 = (wxVariant*) node1->GetData();
wxVariant* var2 = (wxVariant*) node2->Data(); wxVariant* var2 = (wxVariant*) node2->GetData();
if ((*var1) != (*var2)) if ((*var1) != (*var2))
return FALSE; return false;
node1 = node1->Next(); node1 = node1->GetNext();
node2 = node2->Next(); node2 = node2->GetNext();
} }
if (node1 || node2) return FALSE; if (node1 || node2) return false;
return TRUE; return true;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
@@ -164,25 +164,25 @@ bool wxVariantDataList::Write(wxSTD ostream& str) const
wxString s; wxString s;
Write(s); Write(s);
str << (const char*) s.mb_str(); str << (const char*) s.mb_str();
return TRUE; return true;
} }
#endif #endif
bool wxVariantDataList::Write(wxString& str) const bool wxVariantDataList::Write(wxString& str) const
{ {
str = wxT(""); str = wxT("");
wxNode* node = m_value.First(); wxNode* node = m_value.GetFirst();
while (node) while (node)
{ {
wxVariant* var = (wxVariant*) node->Data(); wxVariant* var = (wxVariant*) node->GetData();
if (node != m_value.First()) if (node != m_value.GetFirst())
str += wxT(" "); str += wxT(" ");
wxString str1; wxString str1;
str += var->MakeString(); str += var->MakeString();
node = node->Next(); node = node->GetNext();
} }
return TRUE; return true;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
@@ -190,7 +190,7 @@ bool wxVariantDataList::Read(wxSTD istream& WXUNUSED(str))
{ {
wxFAIL_MSG(wxT("Unimplemented")); wxFAIL_MSG(wxT("Unimplemented"));
// TODO // TODO
return FALSE; return false;
} }
#endif #endif
@@ -198,7 +198,7 @@ bool wxVariantDataList::Read(wxString& WXUNUSED(str))
{ {
wxFAIL_MSG(wxT("Unimplemented")); wxFAIL_MSG(wxT("Unimplemented"));
// TODO // TODO
return FALSE; return false;
} }
/* /*
@@ -252,19 +252,19 @@ bool wxVariantDataStringList::Eq(wxVariantData& data) const
wxASSERT_MSG( (data.GetType() == wxT("stringlist")), wxT("wxVariantDataStringList::Eq: argument mismatch") ); wxASSERT_MSG( (data.GetType() == wxT("stringlist")), wxT("wxVariantDataStringList::Eq: argument mismatch") );
wxVariantDataStringList& listData = (wxVariantDataStringList&) data; wxVariantDataStringList& listData = (wxVariantDataStringList&) data;
wxNode* node1 = m_value.First(); wxStringList::Node *node1 = m_value.GetFirst();
wxNode* node2 = listData.GetValue().First(); wxStringList::Node *node2 = listData.GetValue().GetFirst();
while (node1 && node2) while (node1 && node2)
{ {
wxString str1 ((wxChar*) node1->Data()); wxString str1 ( node1->GetData() );
wxString str2 ((wxChar*) node2->Data()); wxString str2 ( node2->GetData() );
if (str1 != str2) if (str1 != str2)
return FALSE; return false;
node1 = node1->Next(); node1 = node1->GetNext();
node2 = node2->Next(); node2 = node2->GetNext();
} }
if (node1 || node2) return FALSE; if (node1 || node2) return false;
return TRUE; return true;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
@@ -273,24 +273,24 @@ bool wxVariantDataStringList::Write(wxSTD ostream& str) const
wxString s; wxString s;
Write(s); Write(s);
str << (const char*) s.mb_str(); str << (const char*) s.mb_str();
return TRUE; return true;
} }
#endif #endif
bool wxVariantDataStringList::Write(wxString& str) const bool wxVariantDataStringList::Write(wxString& str) const
{ {
str = wxT(""); str.Empty();
wxNode* node = m_value.First(); wxStringList::Node *node = m_value.GetFirst();
while (node) while (node)
{ {
wxChar* s = (wxChar*) node->Data(); wxChar* s = node->GetData();
if (node != m_value.First()) if (node != m_value.GetFirst())
str += wxT(" "); str += wxT(" ");
str += s; str += s;
node = node->Next(); node = node->GetNext();
} }
return TRUE; return true;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
@@ -298,7 +298,7 @@ bool wxVariantDataStringList::Read(wxSTD istream& WXUNUSED(str))
{ {
wxFAIL_MSG(wxT("Unimplemented")); wxFAIL_MSG(wxT("Unimplemented"));
// TODO // TODO
return FALSE; return false;
} }
#endif #endif
@@ -306,7 +306,7 @@ bool wxVariantDataStringList::Read(wxString& WXUNUSED(str))
{ {
wxFAIL_MSG(wxT("Unimplemented")); wxFAIL_MSG(wxT("Unimplemented"));
// TODO // TODO
return FALSE; return false;
} }
/* /*
@@ -369,21 +369,21 @@ bool wxVariantDataLong::Write(wxSTD ostream& str) const
wxString s; wxString s;
Write(s); Write(s);
str << (const char*) s.mb_str(); str << (const char*) s.mb_str();
return TRUE; return true;
} }
#endif #endif
bool wxVariantDataLong::Write(wxString& str) const bool wxVariantDataLong::Write(wxString& str) const
{ {
str.Printf(wxT("%ld"), m_value); str.Printf(wxT("%ld"), m_value);
return TRUE; return true;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
bool wxVariantDataLong::Read(wxSTD istream& str) bool wxVariantDataLong::Read(wxSTD istream& str)
{ {
str >> m_value; str >> m_value;
return TRUE; return true;
} }
#endif #endif
@@ -393,21 +393,21 @@ bool wxVariantDataLong::Write(wxOutputStream& str) const
wxTextOutputStream s(str); wxTextOutputStream s(str);
s.Write32((size_t)m_value); s.Write32((size_t)m_value);
return TRUE; return true;
} }
bool wxVariantDataLong::Read(wxInputStream& str) bool wxVariantDataLong::Read(wxInputStream& str)
{ {
wxTextInputStream s(str); wxTextInputStream s(str);
m_value = s.Read32(); m_value = s.Read32();
return TRUE; return true;
} }
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
bool wxVariantDataLong::Read(wxString& str) bool wxVariantDataLong::Read(wxString& str)
{ {
m_value = wxAtol((const wxChar*) str); m_value = wxAtol((const wxChar*) str);
return TRUE; return true;
} }
/* /*
@@ -470,21 +470,21 @@ bool wxVariantDataReal::Write(wxSTD ostream& str) const
wxString s; wxString s;
Write(s); Write(s);
str << (const char*) s.mb_str(); str << (const char*) s.mb_str();
return TRUE; return true;
} }
#endif #endif
bool wxVariantDataReal::Write(wxString& str) const bool wxVariantDataReal::Write(wxString& str) const
{ {
str.Printf(wxT("%.4f"), m_value); str.Printf(wxT("%.4f"), m_value);
return TRUE; return true;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
bool wxVariantDataReal::Read(wxSTD istream& str) bool wxVariantDataReal::Read(wxSTD istream& str)
{ {
str >> m_value; str >> m_value;
return TRUE; return true;
} }
#endif #endif
@@ -493,21 +493,21 @@ bool wxVariantDataReal::Write(wxOutputStream& str) const
{ {
wxTextOutputStream s(str); wxTextOutputStream s(str);
s.WriteDouble((double)m_value); s.WriteDouble((double)m_value);
return TRUE; return true;
} }
bool wxVariantDataReal::Read(wxInputStream& str) bool wxVariantDataReal::Read(wxInputStream& str)
{ {
wxTextInputStream s(str); wxTextInputStream s(str);
m_value = (float)s.ReadDouble(); m_value = (float)s.ReadDouble();
return TRUE; return true;
} }
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
bool wxVariantDataReal::Read(wxString& str) bool wxVariantDataReal::Read(wxString& str)
{ {
m_value = wxAtof((const wxChar*) str); m_value = wxAtof((const wxChar*) str);
return TRUE; return true;
} }
#ifdef HAVE_BOOL #ifdef HAVE_BOOL
@@ -571,14 +571,14 @@ bool wxVariantDataBool::Write(wxSTD ostream& str) const
wxString s; wxString s;
Write(s); Write(s);
str << (const char*) s.mb_str(); str << (const char*) s.mb_str();
return TRUE; return true;
} }
#endif #endif
bool wxVariantDataBool::Write(wxString& str) const bool wxVariantDataBool::Write(wxString& str) const
{ {
str.Printf(wxT("%d"), (int) m_value); str.Printf(wxT("%d"), (int) m_value);
return TRUE; return true;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
@@ -586,7 +586,7 @@ bool wxVariantDataBool::Read(wxSTD istream& WXUNUSED(str))
{ {
wxFAIL_MSG(wxT("Unimplemented")); wxFAIL_MSG(wxT("Unimplemented"));
// str >> (long) m_value; // str >> (long) m_value;
return FALSE; return false;
} }
#endif #endif
@@ -596,7 +596,7 @@ bool wxVariantDataBool::Write(wxOutputStream& str) const
wxTextOutputStream s(str); wxTextOutputStream s(str);
s.Write8(m_value); s.Write8(m_value);
return TRUE; return true;
} }
bool wxVariantDataBool::Read(wxInputStream& str) bool wxVariantDataBool::Read(wxInputStream& str)
@@ -604,14 +604,14 @@ bool wxVariantDataBool::Read(wxInputStream& str)
wxTextInputStream s(str); wxTextInputStream s(str);
m_value = s.Read8() != 0; m_value = s.Read8() != 0;
return TRUE; return true;
} }
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
bool wxVariantDataBool::Read(wxString& str) bool wxVariantDataBool::Read(wxString& str)
{ {
m_value = (wxAtol((const wxChar*) str) != 0); m_value = (wxAtol((const wxChar*) str) != 0);
return TRUE; return true;
} }
#endif // HAVE_BOOL #endif // HAVE_BOOL
@@ -673,14 +673,14 @@ bool wxVariantDataChar::Write(wxSTD ostream& str) const
wxString s; wxString s;
Write(s); Write(s);
str << (const char*) s.mb_str(); str << (const char*) s.mb_str();
return TRUE; return true;
} }
#endif #endif
bool wxVariantDataChar::Write(wxString& str) const bool wxVariantDataChar::Write(wxString& str) const
{ {
str.Printf(wxT("%c"), m_value); str.Printf(wxT("%c"), m_value);
return TRUE; return true;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
@@ -688,7 +688,7 @@ bool wxVariantDataChar::Read(wxSTD istream& WXUNUSED(str))
{ {
wxFAIL_MSG(wxT("Unimplemented")); wxFAIL_MSG(wxT("Unimplemented"));
// str >> m_value; // str >> m_value;
return FALSE; return false;
} }
#endif #endif
@@ -698,7 +698,7 @@ bool wxVariantDataChar::Write(wxOutputStream& str) const
wxTextOutputStream s(str); wxTextOutputStream s(str);
s.Write8(m_value); s.Write8(m_value);
return TRUE; return true;
} }
bool wxVariantDataChar::Read(wxInputStream& str) bool wxVariantDataChar::Read(wxInputStream& str)
@@ -706,14 +706,14 @@ bool wxVariantDataChar::Read(wxInputStream& str)
wxTextInputStream s(str); wxTextInputStream s(str);
m_value = s.Read8(); m_value = s.Read8();
return TRUE; return true;
} }
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
bool wxVariantDataChar::Read(wxString& str) bool wxVariantDataChar::Read(wxString& str)
{ {
m_value = str[(size_t)0]; m_value = str[(size_t)0];
return TRUE; return true;
} }
/* /*
@@ -781,21 +781,21 @@ bool wxVariantDataString::Eq(wxVariantData& data) const
bool wxVariantDataString::Write(wxSTD ostream& str) const bool wxVariantDataString::Write(wxSTD ostream& str) const
{ {
str << (const char*) m_value.mb_str(); str << (const char*) m_value.mb_str();
return TRUE; return true;
} }
#endif #endif
bool wxVariantDataString::Write(wxString& str) const bool wxVariantDataString::Write(wxString& str) const
{ {
str = m_value; str = m_value;
return TRUE; return true;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
bool wxVariantDataString::Read(wxSTD istream& str) bool wxVariantDataString::Read(wxSTD istream& str)
{ {
str >> m_value; str >> m_value;
return TRUE; return true;
} }
#endif #endif
@@ -805,7 +805,7 @@ bool wxVariantDataString::Write(wxOutputStream& str) const
// why doesn't wxOutputStream::operator<< take "const wxString&" // why doesn't wxOutputStream::operator<< take "const wxString&"
wxTextOutputStream s(str); wxTextOutputStream s(str);
s.WriteString(m_value); s.WriteString(m_value);
return TRUE; return true;
} }
bool wxVariantDataString::Read(wxInputStream& str) bool wxVariantDataString::Read(wxInputStream& str)
@@ -813,14 +813,14 @@ bool wxVariantDataString::Read(wxInputStream& str)
wxTextInputStream s(str); wxTextInputStream s(str);
m_value = s.ReadString(); m_value = s.ReadString();
return TRUE; return true;
} }
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
bool wxVariantDataString::Read(wxString& str) bool wxVariantDataString::Read(wxString& str)
{ {
m_value = str; m_value = str;
return TRUE; return true;
} }
#if defined(__BORLANDC__) && defined(__WIN16__) #if defined(__BORLANDC__) && defined(__WIN16__)
@@ -857,7 +857,7 @@ public:
#endif #endif
virtual bool Read(wxString& str); virtual bool Read(wxString& str);
virtual wxString GetType() const { return wxT("time"); }; virtual wxString GetType() const { return wxT("time"); };
virtual wxVariantData* Clone() { return new wxVariantDataTime; } virtual wxVariantData* Clone() { return new wxVariantDataTime; }
protected: protected:
wxTime m_value; wxTime m_value;
@@ -889,7 +889,7 @@ bool wxVariantDataTime::Write(wxSTD ostream& str) const
wxString s; wxString s;
Write(s); Write(s);
str << (const char*) s.mb_str(); str << (const char*) s.mb_str();
return TRUE; return true;
} }
#endif #endif
@@ -897,21 +897,21 @@ bool wxVariantDataTime::Write(wxString& str) const
{ {
wxChar*s = m_value.FormatTime(); wxChar*s = m_value.FormatTime();
str = s; str = s;
return TRUE; return true;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
bool wxVariantDataTime::Read(wxSTD istream& WXUNUSED(str)) bool wxVariantDataTime::Read(wxSTD istream& WXUNUSED(str))
{ {
// Not implemented // Not implemented
return FALSE; return false;
} }
#endif #endif
bool wxVariantDataTime::Read(wxString& WXUNUSED(str)) bool wxVariantDataTime::Read(wxString& WXUNUSED(str))
{ {
// Not implemented // Not implemented
return FALSE; return false;
} }
/* /*
@@ -939,7 +939,7 @@ public:
#endif #endif
virtual bool Read(wxString& str); virtual bool Read(wxString& str);
virtual wxString GetType() const { return wxT("date"); }; virtual wxString GetType() const { return wxT("date"); };
virtual wxVariantData* Clone() { return new wxVariantDataDate; } virtual wxVariantData* Clone() { return new wxVariantDataDate; }
protected: protected:
wxDate m_value; wxDate m_value;
@@ -971,28 +971,28 @@ bool wxVariantDataDate::Write(wxSTD ostream& str) const
wxString s; wxString s;
Write(s); Write(s);
str << (const char*) s.mb_str(); str << (const char*) s.mb_str();
return TRUE; return true;
} }
#endif #endif
bool wxVariantDataDate::Write(wxString& str) const bool wxVariantDataDate::Write(wxString& str) const
{ {
str = m_value.FormatDate(); str = m_value.FormatDate();
return TRUE; return true;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
bool wxVariantDataDate::Read(wxSTD istream& WXUNUSED(str)) bool wxVariantDataDate::Read(wxSTD istream& WXUNUSED(str))
{ {
// Not implemented // Not implemented
return FALSE; return false;
} }
#endif #endif
bool wxVariantDataDate::Read(wxString& WXUNUSED(str)) bool wxVariantDataDate::Read(wxString& WXUNUSED(str))
{ {
// Not implemented // Not implemented
return FALSE; return false;
} }
#endif #endif
// wxUSE_TIMEDATE // wxUSE_TIMEDATE
@@ -1022,7 +1022,7 @@ public:
#endif #endif
virtual bool Read(wxString& str); virtual bool Read(wxString& str);
virtual wxString GetType() const { return wxT("void*"); }; virtual wxString GetType() const { return wxT("void*"); };
virtual wxVariantData* Clone() { return new wxVariantDataVoidPtr; } virtual wxVariantData* Clone() { return new wxVariantDataVoidPtr; }
protected: protected:
void* m_value; void* m_value;
@@ -1056,28 +1056,28 @@ bool wxVariantDataVoidPtr::Write(wxSTD ostream& str) const
wxString s; wxString s;
Write(s); Write(s);
str << (const char*) s.mb_str(); str << (const char*) s.mb_str();
return TRUE; return true;
} }
#endif #endif
bool wxVariantDataVoidPtr::Write(wxString& str) const bool wxVariantDataVoidPtr::Write(wxString& str) const
{ {
str.Printf(wxT("%ld"), (long) m_value); str.Printf(wxT("%ld"), (long) m_value);
return TRUE; return true;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
bool wxVariantDataVoidPtr::Read(wxSTD istream& WXUNUSED(str)) bool wxVariantDataVoidPtr::Read(wxSTD istream& WXUNUSED(str))
{ {
// Not implemented // Not implemented
return FALSE; return false;
} }
#endif #endif
bool wxVariantDataVoidPtr::Read(wxString& WXUNUSED(str)) bool wxVariantDataVoidPtr::Read(wxString& WXUNUSED(str))
{ {
// Not implemented // Not implemented
return FALSE; return false;
} }
/* /*
@@ -1148,7 +1148,7 @@ bool wxVariantDataDateTime::Eq(wxVariantData& data) const
bool wxVariantDataDateTime::Write(wxSTD ostream& str) const bool wxVariantDataDateTime::Write(wxSTD ostream& str) const
{ {
// Not implemented // Not implemented
return FALSE; return false;
} }
#endif #endif
@@ -1156,7 +1156,7 @@ bool wxVariantDataDateTime::Write(wxSTD ostream& str) const
bool wxVariantDataDateTime::Write(wxString& str) const bool wxVariantDataDateTime::Write(wxString& str) const
{ {
str = m_value.Format(); str = m_value.Format();
return TRUE; return true;
} }
@@ -1164,7 +1164,7 @@ bool wxVariantDataDateTime::Write(wxString& str) const
bool wxVariantDataDateTime::Read(wxSTD istream& WXUNUSED(str)) bool wxVariantDataDateTime::Read(wxSTD istream& WXUNUSED(str))
{ {
// Not implemented // Not implemented
return FALSE; return false;
} }
#endif #endif
@@ -1172,8 +1172,8 @@ bool wxVariantDataDateTime::Read(wxSTD istream& WXUNUSED(str))
bool wxVariantDataDateTime::Read(wxString& str) bool wxVariantDataDateTime::Read(wxString& str)
{ {
if(! m_value.ParseDateTime(str)) if(! m_value.ParseDateTime(str))
return FALSE; return false;
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1234,7 +1234,7 @@ bool wxVariantDataArrayString::Eq(wxVariantData& data) const
bool wxVariantDataArrayString::Write(wxSTD ostream& str) const bool wxVariantDataArrayString::Write(wxSTD ostream& str) const
{ {
// Not implemented // Not implemented
return FALSE; return false;
} }
#endif #endif
@@ -1250,7 +1250,7 @@ bool wxVariantDataArrayString::Write(wxString& str) const
str += m_value[n]; str += m_value[n];
} }
return TRUE; return true;
} }
@@ -1258,7 +1258,7 @@ bool wxVariantDataArrayString::Write(wxString& str) const
bool wxVariantDataArrayString::Read(wxSTD istream& WXUNUSED(str)) bool wxVariantDataArrayString::Read(wxSTD istream& WXUNUSED(str))
{ {
// Not implemented // Not implemented
return FALSE; return false;
} }
#endif #endif
@@ -1271,7 +1271,7 @@ bool wxVariantDataArrayString::Read(wxString& str)
m_value.Add(tk.GetNextToken()); m_value.Add(tk.GetNextToken());
} }
return TRUE; return true;
} }
@@ -1472,7 +1472,7 @@ bool wxVariant::operator== (double value) const
{ {
double thisValue; double thisValue;
if (!Convert(&thisValue)) if (!Convert(&thisValue))
return FALSE; return false;
else else
return (value == thisValue); return (value == thisValue);
} }
@@ -1500,7 +1500,7 @@ bool wxVariant::operator== (long value) const
{ {
long thisValue; long thisValue;
if (!Convert(&thisValue)) if (!Convert(&thisValue))
return FALSE; return false;
else else
return (value == thisValue); return (value == thisValue);
} }
@@ -1528,7 +1528,7 @@ bool wxVariant::operator== (char value) const
{ {
char thisValue; char thisValue;
if (!Convert(&thisValue)) if (!Convert(&thisValue))
return FALSE; return false;
else else
return (value == thisValue); return (value == thisValue);
} }
@@ -1557,7 +1557,7 @@ bool wxVariant::operator== (bool value) const
{ {
bool thisValue; bool thisValue;
if (!Convert(&thisValue)) if (!Convert(&thisValue))
return FALSE; return false;
else else
return (value == thisValue); return (value == thisValue);
} }
@@ -1586,7 +1586,7 @@ bool wxVariant::operator== (const wxString& value) const
{ {
wxString thisValue; wxString thisValue;
if (!Convert(&thisValue)) if (!Convert(&thisValue))
return FALSE; return false;
return value == thisValue; return value == thisValue;
} }
@@ -1684,7 +1684,7 @@ bool wxVariant::operator== (const wxTime& value) const
{ {
wxTime thisValue; wxTime thisValue;
if (!Convert(&thisValue)) if (!Convert(&thisValue))
return FALSE; return false;
return value == thisValue; return value == thisValue;
} }
@@ -1712,7 +1712,7 @@ bool wxVariant::operator== (const wxDate& value) const
{ {
wxDate thisValue; wxDate thisValue;
if (!Convert(&thisValue)) if (!Convert(&thisValue))
return FALSE; return false;
return (value == thisValue); return (value == thisValue);
} }
@@ -1765,7 +1765,7 @@ bool wxVariant::operator== (const wxDateTime& value) const
{ {
wxDateTime thisValue; wxDateTime thisValue;
if (!Convert(&thisValue)) if (!Convert(&thisValue))
return FALSE; return false;
return value.IsEqualTo(thisValue); return value.IsEqualTo(thisValue);
} }
@@ -1819,7 +1819,7 @@ bool wxVariant::operator==(const wxArrayString& WXUNUSED(value)) const
{ {
wxFAIL_MSG( _T("TODO") ); wxFAIL_MSG( _T("TODO") );
return FALSE; return false;
} }
bool wxVariant::operator!=(const wxArrayString& value) const bool wxVariant::operator!=(const wxArrayString& value) const
@@ -1857,15 +1857,15 @@ wxVariant wxVariant::operator[] (size_t idx) const
if (GetType() == wxT("list")) if (GetType() == wxT("list"))
{ {
wxVariantDataList* data = (wxVariantDataList*) m_data; wxVariantDataList* data = (wxVariantDataList*) m_data;
wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), wxT("Invalid index for array") ); wxASSERT_MSG( (idx < (size_t) data->GetValue().GetCount()), wxT("Invalid index for array") );
return * (wxVariant*) (data->GetValue().Nth(idx)->Data()); return * (wxVariant*) (data->GetValue().Item(idx)->GetData());
} }
else if (GetType() == wxT("stringlist")) else if (GetType() == wxT("stringlist"))
{ {
wxVariantDataStringList* data = (wxVariantDataStringList*) m_data; wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), wxT("Invalid index for array") ); wxASSERT_MSG( (idx < (size_t) data->GetValue().GetCount()), wxT("Invalid index for array") );
wxVariant variant( wxString( (wxChar*) (data->GetValue().Nth(idx)->Data()) )); wxVariant variant( wxString( (wxChar*) (data->GetValue().Item(idx)->GetData()) ));
return variant; return variant;
} }
return wxNullVariant; return wxNullVariant;
@@ -1879,9 +1879,9 @@ wxVariant& wxVariant::operator[] (size_t idx)
wxASSERT_MSG( (GetType() == wxT("list")), wxT("Invalid type for array operator") ); wxASSERT_MSG( (GetType() == wxT("list")), wxT("Invalid type for array operator") );
wxVariantDataList* data = (wxVariantDataList*) m_data; wxVariantDataList* data = (wxVariantDataList*) m_data;
wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), wxT("Invalid index for array") ); wxASSERT_MSG( (idx < (size_t) data->GetValue().GetCount()), wxT("Invalid index for array") );
return * (wxVariant*) (data->GetValue().Nth(idx)->Data()); return * (wxVariant*) (data->GetValue().Item(idx)->GetData());
} }
// Return the number of elements in a list // Return the number of elements in a list
@@ -1892,12 +1892,12 @@ int wxVariant::GetCount() const
if (GetType() == wxT("list")) if (GetType() == wxT("list"))
{ {
wxVariantDataList* data = (wxVariantDataList*) m_data; wxVariantDataList* data = (wxVariantDataList*) m_data;
return data->GetValue().Number(); return data->GetValue().GetCount();
} }
else if (GetType() == wxT("stringlist")) else if (GetType() == wxT("stringlist"))
{ {
wxVariantDataStringList* data = (wxVariantDataStringList*) m_data; wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
return data->GetValue().Number(); return data->GetValue().GetCount();
} }
return 0; return 0;
} }
@@ -2078,20 +2078,20 @@ void wxVariant::Insert(const wxVariant& value)
list.Insert(new wxVariant(value)); list.Insert(new wxVariant(value));
} }
// Returns TRUE if the variant is a member of the list // Returns true if the variant is a member of the list
bool wxVariant::Member(const wxVariant& value) const bool wxVariant::Member(const wxVariant& value) const
{ {
wxList& list = GetList(); wxList& list = GetList();
wxNode* node = list.First(); wxNode* node = list.GetFirst();
while (node) while (node)
{ {
wxVariant* other = (wxVariant*) node->Data(); wxVariant* other = (wxVariant*) node->GetData();
if (value == *other) if (value == *other)
return TRUE; return true;
node = node->Next(); node = node->GetNext();
} }
return FALSE; return false;
} }
// Deletes the nth element of the list // Deletes the nth element of the list
@@ -2099,12 +2099,12 @@ bool wxVariant::Delete(int item)
{ {
wxList& list = GetList(); wxList& list = GetList();
wxASSERT_MSG( (item < list.Number()), wxT("Invalid index to Delete") ); wxASSERT_MSG( (item < (int) list.GetCount()), wxT("Invalid index to Delete") );
wxNode* node = list.Nth(item); wxNode* node = list.Item(item);
wxVariant* variant = (wxVariant*) node->Data(); wxVariant* variant = (wxVariant*) node->GetData();
delete variant; delete variant;
delete node; delete node;
return TRUE; return true;
} }
// Clear list // Clear list
@@ -2140,9 +2140,9 @@ bool wxVariant::Convert(long* value) const
else if (type == wxT("string")) else if (type == wxT("string"))
*value = wxAtol((const wxChar*) ((wxVariantDataString*)GetData())->GetValue()); *value = wxAtol((const wxChar*) ((wxVariantDataString*)GetData())->GetValue());
else else
return FALSE; return false;
return TRUE; return true;
} }
bool wxVariant::Convert(bool* value) const bool wxVariant::Convert(bool* value) const
@@ -2161,16 +2161,16 @@ bool wxVariant::Convert(bool* value) const
wxString val(((wxVariantDataString*)GetData())->GetValue()); wxString val(((wxVariantDataString*)GetData())->GetValue());
val.MakeLower(); val.MakeLower();
if (val == wxT("true") || val == wxT("yes")) if (val == wxT("true") || val == wxT("yes"))
*value = TRUE; *value = true;
else if (val == wxT("false") || val == wxT("no")) else if (val == wxT("false") || val == wxT("no"))
*value = FALSE; *value = false;
else else
return FALSE; return false;
} }
else else
return FALSE; return false;
return TRUE; return true;
} }
bool wxVariant::Convert(double* value) const bool wxVariant::Convert(double* value) const
@@ -2187,9 +2187,9 @@ bool wxVariant::Convert(double* value) const
else if (type == wxT("string")) else if (type == wxT("string"))
*value = (double) wxAtof((const wxChar*) ((wxVariantDataString*)GetData())->GetValue()); *value = (double) wxAtof((const wxChar*) ((wxVariantDataString*)GetData())->GetValue());
else else
return FALSE; return false;
return TRUE; return true;
} }
bool wxVariant::Convert(char* value) const bool wxVariant::Convert(char* value) const
@@ -2204,15 +2204,15 @@ bool wxVariant::Convert(char* value) const
*value = (char) (((wxVariantDataBool*)GetData())->GetValue()); *value = (char) (((wxVariantDataBool*)GetData())->GetValue());
#endif #endif
else else
return FALSE; return false;
return TRUE; return true;
} }
bool wxVariant::Convert(wxString* value) const bool wxVariant::Convert(wxString* value) const
{ {
*value = MakeString(); *value = MakeString();
return TRUE; return true;
} }
// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled // For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
@@ -2225,9 +2225,9 @@ bool wxVariant::Convert(wxTime* value) const
else if (type == wxT("date")) else if (type == wxT("date"))
*value = wxTime(((wxVariantDataDate*)GetData())->GetValue()); *value = wxTime(((wxVariantDataDate*)GetData())->GetValue());
else else
return FALSE; return false;
return TRUE; return true;
} }
bool wxVariant::Convert(wxDate* value) const bool wxVariant::Convert(wxDate* value) const
@@ -2236,9 +2236,9 @@ bool wxVariant::Convert(wxDate* value) const
if (type == wxT("date")) if (type == wxT("date"))
*value = ((wxVariantDataDate*)GetData())->GetValue(); *value = ((wxVariantDataDate*)GetData())->GetValue();
else else
return FALSE; return false;
return TRUE; return true;
} }
#endif // wxUSE_TIMEDATE #endif // wxUSE_TIMEDATE
@@ -2248,7 +2248,7 @@ bool wxVariant::Convert(wxDateTime* value) const
if (type == wxT("datetime")) if (type == wxT("datetime"))
{ {
*value = ((wxVariantDataDateTime*)GetData())->GetValue(); *value = ((wxVariantDataDateTime*)GetData())->GetValue();
return TRUE; return true;
} }
// Fallback to string conversion // Fallback to string conversion
wxString val; wxString val;

View File

@@ -1549,13 +1549,13 @@ void wxPostScriptDC::DoDrawSpline( wxList *points )
double a, b, c, d, x1, y1, x2, y2, x3, y3; double a, b, c, d, x1, y1, x2, y2, x3, y3;
wxPoint *p, *q; wxPoint *p, *q;
wxNode *node = points->First(); wxNode *node = points->GetFirst();
p = (wxPoint *)node->Data(); p = (wxPoint *)node->GetData();
x1 = p->x; x1 = p->x;
y1 = p->y; y1 = p->y;
node = node->Next(); node = node->GetNext();
p = (wxPoint *)node->Data(); p = (wxPoint *)node->GetData();
c = p->x; c = p->x;
d = p->y; d = p->y;
x3 = a = (double)(x1 + c) / 2; x3 = a = (double)(x1 + c) / 2;
@@ -1571,9 +1571,9 @@ void wxPostScriptDC::DoDrawSpline( wxList *points )
CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 ); CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 );
CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 ); CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 );
while ((node = node->Next()) != NULL) while ((node = node->GetNext()) != NULL)
{ {
q = (wxPoint *)node->Data(); q = (wxPoint *)node->GetData();
x1 = x3; x1 = x3;
y1 = y3; y1 = y3;

View File

@@ -86,12 +86,12 @@ wxHTMLHelpControllerBase::DeleteList()
{ {
if(m_MapList) if(m_MapList)
{ {
wxNode *node = m_MapList->First(); wxNode *node = m_MapList->GetFirst();
while (node) while (node)
{ {
delete (wxExtHelpMapEntry *)node->Data(); delete (wxExtHelpMapEntry *)node->GetData();
delete node; delete node;
node = m_MapList->First(); node = m_MapList->GetFirst();
} }
delete m_MapList; delete m_MapList;
m_MapList = (wxList*) NULL; m_MapList = (wxList*) NULL;
@@ -222,17 +222,17 @@ wxHTMLHelpControllerBase::DisplayContents()
return FALSE; return FALSE;
wxString contents; wxString contents;
wxNode *node = m_MapList->First(); wxNode *node = m_MapList->GetFirst();
wxExtHelpMapEntry *entry; wxExtHelpMapEntry *entry;
while(node) while(node)
{ {
entry = (wxExtHelpMapEntry *)node->Data(); entry = (wxExtHelpMapEntry *)node->GetData();
if(entry->id == CONTENTS_ID) if(entry->id == CONTENTS_ID)
{ {
contents = entry->url; contents = entry->url;
break; break;
} }
node = node->Next(); node = node->GetNext();
} }
bool rc = FALSE; bool rc = FALSE;
@@ -254,14 +254,14 @@ wxHTMLHelpControllerBase::DisplaySection(int sectionNo)
return FALSE; return FALSE;
wxBusyCursor b; // display a busy cursor wxBusyCursor b; // display a busy cursor
wxNode *node = m_MapList->First(); wxNode *node = m_MapList->GetFirst();
wxExtHelpMapEntry *entry; wxExtHelpMapEntry *entry;
while(node) while(node)
{ {
entry = (wxExtHelpMapEntry *)node->Data(); entry = (wxExtHelpMapEntry *)node->GetData();
if(entry->id == sectionNo) if(entry->id == sectionNo)
return DisplayHelp(entry->url); return DisplayHelp(entry->url);
node = node->Next(); node = node->GetNext();
} }
return FALSE; return FALSE;
} }
@@ -295,7 +295,7 @@ wxHTMLHelpControllerBase::KeywordSearch(const wxString& k)
int idx = 0, j; int idx = 0, j;
bool rc; bool rc;
bool showAll = k.IsEmpty(); bool showAll = k.IsEmpty();
wxNode *node = m_MapList->First(); wxNode *node = m_MapList->GetFirst();
wxExtHelpMapEntry *entry; wxExtHelpMapEntry *entry;
{ {
@@ -303,7 +303,7 @@ wxHTMLHelpControllerBase::KeywordSearch(const wxString& k)
compA = k; compA.LowerCase(); // we compare case insensitive compA = k; compA.LowerCase(); // we compare case insensitive
while(node) while(node)
{ {
entry = (wxExtHelpMapEntry *)node->Data(); entry = (wxExtHelpMapEntry *)node->GetData();
compB = entry->doc; compB.LowerCase(); compB = entry->doc; compB.LowerCase();
if((showAll || compB.Contains(k)) && ! compB.IsEmpty()) if((showAll || compB.Contains(k)) && ! compB.IsEmpty())
{ {
@@ -318,7 +318,7 @@ wxHTMLHelpControllerBase::KeywordSearch(const wxString& k)
choices[idx] << entry->doc.c_str()[j]; choices[idx] << entry->doc.c_str()[j];
idx++; idx++;
} }
node = node->Next(); node = node->GetNext();
} }
} }

View File

@@ -48,7 +48,7 @@ wxGenericImageList::~wxGenericImageList()
int wxGenericImageList::GetImageCount() const int wxGenericImageList::GetImageCount() const
{ {
return m_images.Number(); return m_images.GetCount();
} }
bool wxGenericImageList::Create( int width, int height, bool WXUNUSED(mask), int WXUNUSED(initialCount) ) bool wxGenericImageList::Create( int width, int height, bool WXUNUSED(mask), int WXUNUSED(initialCount) )
@@ -71,7 +71,7 @@ int wxGenericImageList::Add( const wxBitmap &bitmap )
m_images.Append( new wxIcon( (const wxIcon&) bitmap ) ); m_images.Append( new wxIcon( (const wxIcon&) bitmap ) );
else else
m_images.Append( new wxBitmap(bitmap) ); m_images.Append( new wxBitmap(bitmap) );
return m_images.Number()-1; return m_images.GetCount()-1;
} }
int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask ) int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask )
@@ -91,16 +91,16 @@ int wxGenericImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour
const wxBitmap *wxGenericImageList::GetBitmap( int index ) const const wxBitmap *wxGenericImageList::GetBitmap( int index ) const
{ {
wxNode *node = m_images.Nth( index ); wxNode *node = m_images.Item( index );
wxCHECK_MSG( node, (wxBitmap *) NULL, wxT("wrong index in image list") ); wxCHECK_MSG( node, (wxBitmap *) NULL, wxT("wrong index in image list") );
return (wxBitmap*)node->Data(); return (wxBitmap*)node->GetData();
} }
bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap ) bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
{ {
wxNode *node = m_images.Nth( index ); wxNode *node = m_images.Item( index );
wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") ); wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") );
@@ -116,14 +116,14 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
else else
newBitmap = new wxBitmap(bitmap) ; newBitmap = new wxBitmap(bitmap) ;
if (index == m_images.Number()-1) if (index == (int) m_images.GetCount() - 1)
{ {
m_images.DeleteNode( node ); m_images.DeleteNode( node );
m_images.Append( newBitmap ); m_images.Append( newBitmap );
} }
else else
{ {
wxNode *next = node->Next(); wxNode *next = node->GetNext();
m_images.DeleteNode( node ); m_images.DeleteNode( node );
m_images.Insert( next, newBitmap ); m_images.Insert( next, newBitmap );
} }
@@ -133,7 +133,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
bool wxGenericImageList::Remove( int index ) bool wxGenericImageList::Remove( int index )
{ {
wxNode *node = m_images.Nth( index ); wxNode *node = m_images.Item( index );
wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") ); wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") );
@@ -154,11 +154,11 @@ bool wxGenericImageList::GetSize( int index, int &width, int &height ) const
width = 0; width = 0;
height = 0; height = 0;
wxNode *node = m_images.Nth( index ); wxNode *node = m_images.Item( index );
wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") ); wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") );
wxBitmap *bm = (wxBitmap*)node->Data(); wxBitmap *bm = (wxBitmap*)node->GetData();
width = bm->GetWidth(); width = bm->GetWidth();
height = bm->GetHeight(); height = bm->GetHeight();
@@ -168,11 +168,11 @@ bool wxGenericImageList::GetSize( int index, int &width, int &height ) const
bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y, bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y,
int flags, bool WXUNUSED(solidBackground) ) int flags, bool WXUNUSED(solidBackground) )
{ {
wxNode *node = m_images.Nth( index ); wxNode *node = m_images.Item( index );
wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") ); wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") );
wxBitmap *bm = (wxBitmap*)node->Data(); wxBitmap *bm = (wxBitmap*)node->GetData();
if (bm->IsKindOf(CLASSINFO(wxIcon))) if (bm->IsKindOf(CLASSINFO(wxIcon)))
dc.DrawIcon( * ((wxIcon*) bm), x, y); dc.DrawIcon( * ((wxIcon*) bm), x, y);

View File

@@ -195,10 +195,10 @@ bool wxLayoutAlgorithm::LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* r)
wxCalculateLayoutEvent event; wxCalculateLayoutEvent event;
event.SetRect(rect); event.SetRect(rect);
wxNode* node = frame->GetChildren().First(); wxWindowList::Node *node = frame->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindow* win = (wxWindow*) node->Data(); wxWindow* win = node->GetData();
event.SetId(win->GetId()); event.SetId(win->GetId());
event.SetEventObject(win); event.SetEventObject(win);
@@ -206,7 +206,7 @@ bool wxLayoutAlgorithm::LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* r)
win->GetEventHandler()->ProcessEvent(event); win->GetEventHandler()->ProcessEvent(event);
node = node->Next(); node = node->GetNext();
} }
wxWindow* clientWindow = frame->GetClientWindow(); wxWindow* clientWindow = frame->GetClientWindow();
@@ -263,11 +263,12 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
// Find the last layout-aware window, so we can make it fill all remaining // Find the last layout-aware window, so we can make it fill all remaining
// space. // space.
wxWindow* lastAwareWindow = NULL; wxWindow *lastAwareWindow = NULL;
wxNode* node = parent->GetChildren().First(); wxWindowList::Node *node = parent->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindow* win = (wxWindow*) node->Data(); wxWindow* win = node->GetData();
if (win->IsShown()) if (win->IsShown())
{ {
@@ -279,14 +280,14 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
lastAwareWindow = win; lastAwareWindow = win;
} }
node = node->Next(); node = node->GetNext();
} }
// Now do a dummy run to see if we have any space left for the final window (fail if not) // Now do a dummy run to see if we have any space left for the final window (fail if not)
node = parent->GetChildren().First(); node = parent->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindow* win = (wxWindow*) node->Data(); wxWindow* win = node->GetData();
// If mainWindow is NULL and we're at the last window, // If mainWindow is NULL and we're at the last window,
// skip this, because we'll simply make it fit the remaining space. // skip this, because we'll simply make it fit the remaining space.
@@ -299,7 +300,7 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
win->GetEventHandler()->ProcessEvent(event); win->GetEventHandler()->ProcessEvent(event);
} }
node = node->Next(); node = node->GetNext();
} }
if (event.GetRect().GetWidth() < 0 || event.GetRect().GetHeight() < 0) if (event.GetRect().GetWidth() < 0 || event.GetRect().GetHeight() < 0)
@@ -307,10 +308,10 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
event.SetRect(rect); event.SetRect(rect);
node = parent->GetChildren().First(); node = parent->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindow* win = (wxWindow*) node->Data(); wxWindow* win = node->GetData();
// If mainWindow is NULL and we're at the last window, // If mainWindow is NULL and we're at the last window,
// skip this, because we'll simply make it fit the remaining space. // skip this, because we'll simply make it fit the remaining space.
@@ -323,7 +324,7 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
win->GetEventHandler()->ProcessEvent(event); win->GetEventHandler()->ProcessEvent(event);
} }
node = node->Next(); node = node->GetNext();
} }
rect = event.GetRect(); rect = event.GetRect();

View File

@@ -171,7 +171,7 @@ void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent))
2, choices, 2, choices,
1, wxRA_VERTICAL); 1, wxRA_VERTICAL);
m_rangeRadioBox->SetSelection(1); m_rangeRadioBox->SetSelection(1);
mainsizer->Add( m_rangeRadioBox, 0, wxLEFT|wxTOP|wxRIGHT, 10 ); mainsizer->Add( m_rangeRadioBox, 0, wxLEFT|wxTOP|wxRIGHT, 10 );
} }
@@ -520,13 +520,13 @@ wxComboBox *wxGenericPrintSetupDialog::CreatePaperTypeChoice(int *x, int *y)
wxThePrintPaperDatabase->CreateDatabase(); wxThePrintPaperDatabase->CreateDatabase();
} }
*/ */
int n = wxThePrintPaperDatabase->Number(); size_t n = wxThePrintPaperDatabase->GetCount();
wxString *choices = new wxString [n]; wxString *choices = new wxString [n];
int sel = 0; size_t sel = 0;
int i;
for (i = 0; i < n; i++) for (size_t i = 0; i < n; i++)
{ {
wxPrintPaperType *paper = (wxPrintPaperType *)wxThePrintPaperDatabase->Nth(i)->Data(); wxPrintPaperType *paper = (wxPrintPaperType *)wxThePrintPaperDatabase->Item(i)->GetData();
choices[i] = paper->GetName(); choices[i] = paper->GetName();
if (m_printData.GetPaperId() == paper->GetId()) if (m_printData.GetPaperId() == paper->GetId())
sel = i; sel = i;
@@ -534,10 +534,12 @@ wxComboBox *wxGenericPrintSetupDialog::CreatePaperTypeChoice(int *x, int *y)
int width = 250; int width = 250;
wxComboBox *choice = new wxComboBox(this, wxPRINTID_PAPERSIZE, wxComboBox *choice = new wxComboBox( this,
_("Paper Size"), wxPRINTID_PAPERSIZE,
wxPoint(*x, *y), wxSize(width, -1), n, _("Paper Size"),
choices); wxPoint(*x, *y),
wxSize(width, -1),
n, choices );
// SetFont(thisFont); // SetFont(thisFont);
@@ -583,31 +585,41 @@ void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event))
TransferDataToWindow(); TransferDataToWindow();
} }
wxGenericPageSetupDialog::wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data): wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
wxDialog(parent, -1, _("Page Setup"), wxPoint(0, 0), wxSize(600, 600), wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL) wxPageSetupData* data)
: wxDialog( parent,
-1,
_("Page Setup"),
wxPoint(0, 0),
wxSize(600, 600),
wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL )
{ {
if (data) if (data)
m_pageData = *data; m_pageData = *data;
int textWidth = 80; int textWidth = 80;
wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );
// 1) top // 1) top
wxStaticBoxSizer *topsizer = new wxStaticBoxSizer( wxStaticBoxSizer *topsizer = new wxStaticBoxSizer(
new wxStaticBox(this,wxPRINTID_STATIC, _("Paper size")), wxHORIZONTAL ); new wxStaticBox(this,wxPRINTID_STATIC, _("Paper size")), wxHORIZONTAL );
int n = wxThePrintPaperDatabase->Number(); size_t n = wxThePrintPaperDatabase->GetCount();
wxString *choices = new wxString [n]; wxString *choices = new wxString [n];
int i;
for (i = 0; i < n; i++) for (size_t i = 0; i < n; i++)
{ {
wxPrintPaperType *paper = (wxPrintPaperType *)wxThePrintPaperDatabase->Nth(i)->Data(); wxPrintPaperType *paper = (wxPrintPaperType *)wxThePrintPaperDatabase->Item(i)->GetData();
choices[i] = paper->GetName(); choices[i] = paper->GetName();
} }
m_paperTypeChoice = new wxComboBox(this, wxPRINTID_PAPERSIZE, _("Paper Size"), m_paperTypeChoice = new wxComboBox( this,
wxDefaultPosition, wxSize(300, -1), n, choices); wxPRINTID_PAPERSIZE,
_("Paper Size"),
wxDefaultPosition,
wxSize(300, -1),
n, choices );
topsizer->Add( m_paperTypeChoice, 1, wxEXPAND|wxALL, 5 ); topsizer->Add( m_paperTypeChoice, 1, wxEXPAND|wxALL, 5 );
// m_paperTypeChoice->SetSelection(sel); // m_paperTypeChoice->SetSelection(sel);
@@ -778,22 +790,24 @@ wxComboBox *wxGenericPageSetupDialog::CreatePaperTypeChoice(int *x, int *y)
} }
*/ */
int n = wxThePrintPaperDatabase->Number(); size_t n = wxThePrintPaperDatabase->GetCount();
wxString *choices = new wxString [n]; wxString *choices = new wxString [n];
int i;
for (i = 0; i < n; i++) for (size_t i = 0; i < n; i++)
{ {
wxPrintPaperType *paper = (wxPrintPaperType *)wxThePrintPaperDatabase->Nth(i)->Data(); wxPrintPaperType *paper = (wxPrintPaperType *)wxThePrintPaperDatabase->Item(i)->GetData();
choices[i] = paper->GetName(); choices[i] = paper->GetName();
} }
(void) new wxStaticText(this, wxPRINTID_STATIC, _("Paper size"), wxPoint(*x, *y)); (void) new wxStaticText(this, wxPRINTID_STATIC, _("Paper size"), wxPoint(*x, *y));
*y += 25; *y += 25;
wxComboBox *choice = new wxComboBox(this, wxPRINTID_PAPERSIZE, wxComboBox *choice = new wxComboBox( this,
_("Paper Size"), wxPRINTID_PAPERSIZE,
wxPoint(*x, *y), wxSize(300, -1), n, _("Paper Size"),
choices); wxPoint(*x, *y),
wxSize(300, -1),
n, choices );
*y += 35; *y += 35;
delete[] choices; delete[] choices;

View File

@@ -159,12 +159,12 @@ wxPropertyValue::wxPropertyValue(wxList *the_list)
m_last = NULL; m_last = NULL;
m_value.first = NULL; m_value.first = NULL;
wxNode *node = the_list->First(); wxNode *node = the_list->GetFirst();
while (node) while (node)
{ {
wxPropertyValue *expr = (wxPropertyValue *)node->Data(); wxPropertyValue *expr = (wxPropertyValue *)node->GetData();
Append(expr); Append(expr);
node = node->Next(); node = node->GetNext();
} }
delete the_list; delete the_list;
@@ -178,12 +178,12 @@ wxPropertyValue::wxPropertyValue(wxStringList *the_list)
m_last = NULL; m_last = NULL;
m_value.first = NULL; m_value.first = NULL;
wxNode *node = the_list->First(); wxStringList::Node *node = the_list->GetFirst();
while (node) while (node)
{ {
wxChar *s = (wxChar *)node->Data(); wxChar *s = node->GetData();
Append(new wxPropertyValue(s)); Append(new wxPropertyValue(s));
node = node->Next(); node = node->GetNext();
} }
delete the_list; delete the_list;
} }
@@ -939,14 +939,14 @@ wxPropertyValidator *wxPropertyView::FindPropertyValidator(wxProperty *property)
if (property->GetValidator()) if (property->GetValidator())
return property->GetValidator(); return property->GetValidator();
wxNode *node = m_validatorRegistryList.First(); wxNode *node = m_validatorRegistryList.GetFirst();
while (node) while (node)
{ {
wxPropertyValidatorRegistry *registry = (wxPropertyValidatorRegistry *)node->Data(); wxPropertyValidatorRegistry *registry = (wxPropertyValidatorRegistry *)node->GetData();
wxPropertyValidator *validator = registry->GetValidator(property->GetRole()); wxPropertyValidator *validator = registry->GetValidator(property->GetRole());
if (validator) if (validator)
return validator; return validator;
node = node->Next(); node = node->GetNext();
} }
return NULL; return NULL;
/* /*
@@ -989,7 +989,7 @@ wxProperty *wxPropertySheet::GetProperty(const wxString& name) const
if (!node) if (!node)
return NULL; return NULL;
else else
return (wxProperty *)node->Data(); return (wxProperty *)node->GetData();
} }
bool wxPropertySheet::SetProperty(const wxString& name, const wxPropertyValue& value) bool wxPropertySheet::SetProperty(const wxString& name, const wxPropertyValue& value)
@@ -1008,7 +1008,7 @@ void wxPropertySheet::RemoveProperty(const wxString& name)
wxNode *node = m_properties.Find(name); wxNode *node = m_properties.Find(name);
if(node) if(node)
{ {
wxProperty *prop = (wxProperty *)node->Data(); wxProperty *prop = (wxProperty *)node->GetData();
delete prop; delete prop;
m_properties.DeleteNode(node); m_properties.DeleteNode(node);
} }
@@ -1022,11 +1022,11 @@ bool wxPropertySheet::HasProperty(const wxString& name) const
// Clear all properties // Clear all properties
void wxPropertySheet::Clear(void) void wxPropertySheet::Clear(void)
{ {
wxNode *node = m_properties.First(); wxNode *node = m_properties.GetFirst();
while (node) while (node)
{ {
wxProperty *prop = (wxProperty *)node->Data(); wxProperty *prop = (wxProperty *)node->GetData();
wxNode *next = node->Next(); wxNode *next = node->GetNext();
delete prop; delete prop;
delete node; delete node;
node = next; node = next;
@@ -1036,12 +1036,12 @@ void wxPropertySheet::Clear(void)
// Sets/clears the modified flag for each property value // Sets/clears the modified flag for each property value
void wxPropertySheet::SetAllModified(bool flag) void wxPropertySheet::SetAllModified(bool flag)
{ {
wxNode *node = m_properties.First(); wxNode *node = m_properties.GetFirst();
while (node) while (node)
{ {
wxProperty *prop = (wxProperty *)node->Data(); wxProperty *prop = (wxProperty *)node->GetData();
prop->GetValue().SetModified(flag); prop->GetValue().SetModified(flag);
node = node->Next(); node = node->GetNext();
} }
} }
@@ -1077,7 +1077,7 @@ void wxPropertyValidatorRegistry::ClearRegistry(void)
wxNode *node; wxNode *node;
while ((node = Next()) != NULL) while ((node = Next()) != NULL)
{ {
delete (wxPropertyValidator *)node->Data(); delete (wxPropertyValidator *)node->GetData();
} }
} }

View File

@@ -87,10 +87,10 @@ bool wxPropertyFormView::Check(void)
if (!m_propertySheet) if (!m_propertySheet)
return FALSE; return FALSE;
wxNode *node = m_propertySheet->GetProperties().First(); wxNode *node = m_propertySheet->GetProperties().GetFirst();
while (node) while (node)
{ {
wxProperty *prop = (wxProperty *)node->Data(); wxProperty *prop = (wxProperty *)node->GetData();
wxPropertyValidator *validator = FindPropertyValidator(prop); wxPropertyValidator *validator = FindPropertyValidator(prop);
if (validator && validator->IsKindOf(CLASSINFO(wxPropertyFormValidator))) if (validator && validator->IsKindOf(CLASSINFO(wxPropertyFormValidator)))
{ {
@@ -98,7 +98,7 @@ bool wxPropertyFormView::Check(void)
if (!formValidator->OnCheckValue(prop, this, m_propertyWindow)) if (!formValidator->OnCheckValue(prop, this, m_propertyWindow))
return FALSE; return FALSE;
} }
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
} }
@@ -108,17 +108,17 @@ bool wxPropertyFormView::TransferToPropertySheet(void)
if (!m_propertySheet) if (!m_propertySheet)
return FALSE; return FALSE;
wxNode *node = m_propertySheet->GetProperties().First(); wxNode *node = m_propertySheet->GetProperties().GetFirst();
while (node) while (node)
{ {
wxProperty *prop = (wxProperty *)node->Data(); wxProperty *prop = (wxProperty *)node->GetData();
wxPropertyValidator *validator = FindPropertyValidator(prop); wxPropertyValidator *validator = FindPropertyValidator(prop);
if (validator && validator->IsKindOf(CLASSINFO(wxPropertyFormValidator))) if (validator && validator->IsKindOf(CLASSINFO(wxPropertyFormValidator)))
{ {
wxPropertyFormValidator *formValidator = (wxPropertyFormValidator *)validator; wxPropertyFormValidator *formValidator = (wxPropertyFormValidator *)validator;
formValidator->OnRetrieveValue(prop, this, m_propertyWindow); formValidator->OnRetrieveValue(prop, this, m_propertyWindow);
} }
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
} }
@@ -128,17 +128,17 @@ bool wxPropertyFormView::TransferToDialog(void)
if (!m_propertySheet) if (!m_propertySheet)
return FALSE; return FALSE;
wxNode *node = m_propertySheet->GetProperties().First(); wxNode *node = m_propertySheet->GetProperties().GetFirst();
while (node) while (node)
{ {
wxProperty *prop = (wxProperty *)node->Data(); wxProperty *prop = (wxProperty *)node->GetData();
wxPropertyValidator *validator = FindPropertyValidator(prop); wxPropertyValidator *validator = FindPropertyValidator(prop);
if (validator && validator->IsKindOf(CLASSINFO(wxPropertyFormValidator))) if (validator && validator->IsKindOf(CLASSINFO(wxPropertyFormValidator)))
{ {
wxPropertyFormValidator *formValidator = (wxPropertyFormValidator *)validator; wxPropertyFormValidator *formValidator = (wxPropertyFormValidator *)validator;
formValidator->OnDisplayValue(prop, this, m_propertyWindow); formValidator->OnDisplayValue(prop, this, m_propertyWindow);
} }
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
} }
@@ -148,17 +148,17 @@ bool wxPropertyFormView::AssociateNames(void)
if (!m_propertySheet || !m_propertyWindow) if (!m_propertySheet || !m_propertyWindow)
return FALSE; return FALSE;
wxNode *node = m_propertyWindow->GetChildren().First(); wxWindowList::Node *node = m_propertyWindow->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindow *win = (wxWindow *)node->Data(); wxWindow *win = node->GetData();
if (win->GetName() != wxT("")) if ( win->GetName() != wxEmptyString )
{ {
wxProperty *prop = m_propertySheet->GetProperty(win->GetName()); wxProperty *prop = m_propertySheet->GetProperty(win->GetName());
if (prop) if (prop)
prop->SetWindow(win); prop->SetWindow(win);
} }
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
} }
@@ -229,10 +229,10 @@ void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event)
else else
{ {
// Find a validator to route the command to. // Find a validator to route the command to.
wxNode *node = m_propertySheet->GetProperties().First(); wxNode *node = m_propertySheet->GetProperties().GetFirst();
while (node) while (node)
{ {
wxProperty *prop = (wxProperty *)node->Data(); wxProperty *prop = (wxProperty *)node->GetData();
if (prop->GetWindow() && (prop->GetWindow() == &win)) if (prop->GetWindow() && (prop->GetWindow() == &win))
{ {
wxPropertyValidator *validator = FindPropertyValidator(prop); wxPropertyValidator *validator = FindPropertyValidator(prop);
@@ -243,7 +243,7 @@ void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event)
return; return;
} }
} }
node = node->Next(); node = node->GetNext();
} }
} }
} }
@@ -268,10 +268,10 @@ void wxPropertyFormView::OnDoubleClick(wxControl *item)
return; return;
// Find a validator to route the command to. // Find a validator to route the command to.
wxNode *node = m_propertySheet->GetProperties().First(); wxNode *node = m_propertySheet->GetProperties().GetFirst();
while (node) while (node)
{ {
wxProperty *prop = (wxProperty *)node->Data(); wxProperty *prop = (wxProperty *)node->GetData();
if (prop->GetWindow() && ((wxControl *)prop->GetWindow() == item)) if (prop->GetWindow() && ((wxControl *)prop->GetWindow() == item))
{ {
wxPropertyValidator *validator = FindPropertyValidator(prop); wxPropertyValidator *validator = FindPropertyValidator(prop);
@@ -282,7 +282,7 @@ void wxPropertyFormView::OnDoubleClick(wxControl *item)
return; return;
} }
} }
node = node->Next(); node = node->GetNext();
} }
} }
@@ -716,12 +716,12 @@ bool wxStringFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormV
if (lbox->GetCount() == 0 && m_strings) if (lbox->GetCount() == 0 && m_strings)
{ {
// Try to initialize the listbox from 'strings' // Try to initialize the listbox from 'strings'
wxNode *node = m_strings->First(); wxStringList::Node *node = m_strings->GetFirst();
while (node) while (node)
{ {
wxChar *s = (wxChar *)node->Data(); wxChar *s = node->GetData();
lbox->Append(s); lbox->Append(s);
node = node->Next(); node = node->GetNext();
} }
} }
lbox->SetStringSelection(property->GetValue().StringValue()); lbox->SetStringSelection(property->GetValue().StringValue());
@@ -740,12 +740,12 @@ bool wxStringFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormV
{ {
// Try to initialize the choice item from 'strings' // Try to initialize the choice item from 'strings'
// XView doesn't allow this kind of thing. // XView doesn't allow this kind of thing.
wxNode *node = m_strings->First(); wxStringList::Node *node = m_strings->GetFirst();
while (node) while (node)
{ {
wxChar *s = (wxChar *)node->Data(); wxChar *s = node->GetData();
choice->Append(s); choice->Append(s);
node = node->Next(); node = node->GetNext();
} }
} }
choice->SetStringSelection(property->GetValue().StringValue()); choice->SetStringSelection(property->GetValue().StringValue());

View File

@@ -151,16 +151,16 @@ bool wxPropertyListView::UpdatePropertyList(bool clearEditArea)
m_valueList->Clear(); m_valueList->Clear();
m_valueText->SetValue( wxT("") ); m_valueText->SetValue( wxT("") );
} }
wxNode *node = m_propertySheet->GetProperties().First(); wxNode *node = m_propertySheet->GetProperties().GetFirst();
// Should sort them... later... // Should sort them... later...
while (node) while (node)
{ {
wxProperty *property = (wxProperty *)node->Data(); wxProperty *property = (wxProperty *)node->GetData();
wxString stringValueRepr(property->GetValue().GetStringRepresentation()); wxString stringValueRepr(property->GetValue().GetStringRepresentation());
wxString paddedString(MakeNameValueString(property->GetName(), stringValueRepr)); wxString paddedString(MakeNameValueString(property->GetName(), stringValueRepr));
m_propertyScrollingList->Append(paddedString.GetData(), (void *)property); m_propertyScrollingList->Append(paddedString.GetData(), (void *)property);
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
} }
@@ -1196,18 +1196,20 @@ bool wxStringListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wx
return TRUE; return TRUE;
} }
bool wxStringListValidator::OnPrepareDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) bool wxStringListValidator::OnPrepareDetailControls( wxProperty *property,
wxPropertyListView *view,
wxWindow *WXUNUSED(parentWindow) )
{ {
if (view->GetValueList()) if (view->GetValueList())
{ {
view->ShowListBoxControl(TRUE); view->ShowListBoxControl(TRUE);
view->GetValueList()->Enable(TRUE); view->GetValueList()->Enable(TRUE);
wxNode *node = m_strings->First(); wxStringList::Node *node = m_strings->GetFirst();
while (node) while (node)
{ {
wxChar *s = (wxChar *)node->Data(); wxChar *s = node->GetData();
view->GetValueList()->Append(s); view->GetValueList()->Append(s);
node = node->Next(); node = node->GetNext();
} }
wxChar *currentString = property->GetValue().StringValue(); wxChar *currentString = property->GetValue().StringValue();
view->GetValueList()->SetStringSelection(currentString); view->GetValueList()->SetStringSelection(currentString);
@@ -1233,32 +1235,34 @@ bool wxStringListValidator::OnClearDetailControls(wxProperty *WXUNUSED(property)
// Called when the property is double clicked. Extra functionality can be provided, // Called when the property is double clicked. Extra functionality can be provided,
// cycling through possible values. // cycling through possible values.
bool wxStringListValidator::OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) bool wxStringListValidator::OnDoubleClick( wxProperty *property,
wxPropertyListView *view,
wxWindow *WXUNUSED(parentWindow) )
{ {
if (!view->GetValueText()) if (!view->GetValueText())
return FALSE; return FALSE;
if (!m_strings) if (!m_strings)
return FALSE; return FALSE;
wxNode *node = m_strings->First(); wxStringList::Node *node = m_strings->GetFirst();
wxChar *currentString = property->GetValue().StringValue(); wxChar *currentString = property->GetValue().StringValue();
while (node) while (node)
{ {
wxChar *s = (wxChar *)node->Data(); wxChar *s = node->GetData();
if (wxStrcmp(s, currentString) == 0) if (wxStrcmp(s, currentString) == 0)
{ {
wxChar *nextString = NULL; wxChar *nextString = NULL;
if (node->Next()) if (node->GetNext())
nextString = (wxChar *)node->Next()->Data(); nextString = node->GetNext()->GetData();
else else
nextString = (wxChar *)m_strings->First()->Data(); nextString = m_strings->GetFirst()->GetData();
property->GetValue() = wxString(nextString); property->GetValue() = wxString(nextString);
view->DisplayProperty(property); view->DisplayProperty(property);
view->UpdatePropertyDisplayInList(property); view->UpdatePropertyDisplayInList(property);
view->OnPropertyChanged(property); view->OnPropertyChanged(property);
return TRUE; return TRUE;
} }
else node = node->Next(); else node = node->GetNext();
} }
return TRUE; return TRUE;
} }
@@ -1521,7 +1525,9 @@ bool wxListOfStringsListValidator::OnDoubleClick(wxProperty *property, wxPropert
return TRUE; return TRUE;
} }
void wxListOfStringsListValidator::OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow) void wxListOfStringsListValidator::OnEdit( wxProperty *property,
wxPropertyListView *view,
wxWindow *parentWindow )
{ {
// Convert property value to a list of strings for editing // Convert property value to a list of strings for editing
wxStringList *stringList = new wxStringList; wxStringList *stringList = new wxStringList;
@@ -1542,13 +1548,13 @@ void wxListOfStringsListValidator::OnEdit(wxProperty *property, wxPropertyListVi
{ {
wxPropertyValue& oldValue = property->GetValue(); wxPropertyValue& oldValue = property->GetValue();
oldValue.ClearList(); oldValue.ClearList();
wxNode *node = stringList->First(); wxStringList::Node *node = stringList->GetFirst();
while (node) while (node)
{ {
wxChar *s = (wxChar *)node->Data(); wxChar *s = node->GetData();
oldValue.Append(new wxPropertyValue(s)); oldValue.Append(new wxPropertyValue(s));
node = node->Next(); node = node->GetNext();
} }
view->DisplayProperty(property); view->DisplayProperty(property);
@@ -1698,13 +1704,13 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList
c->height.AsIs(); c->height.AsIs();
okButton->SetConstraints(c); okButton->SetConstraints(c);
wxNode *node = stringList->First(); wxStringList::Node *node = stringList->GetFirst();
while (node) while (node)
{ {
wxChar *str = (wxChar *)node->Data(); wxChar *str = node->GetData();
// Save node as client data for each listbox item // Save node as client data for each listbox item
dialog->m_listBox->Append(str, (wxChar *)node); dialog->m_listBox->Append(str, (wxChar *)node);
node = node->Next(); node = node->GetNext();
} }
dialog->SetClientSize(310, 305); dialog->SetClientSize(310, 305);
@@ -1745,7 +1751,7 @@ void wxPropertyStringListEditorDialog::OnDelete(wxCommandEvent& WXUNUSED(event))
return; return;
m_listBox->Delete(sel); m_listBox->Delete(sel);
delete[] (wxChar *)node->Data(); delete[] (wxChar *)node->GetData();
delete node; delete node;
m_currentSelection = -1; m_currentSelection = -1;
m_stringText->SetValue(_T("")); m_stringText->SetValue(_T(""));
@@ -1758,7 +1764,7 @@ void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event))
wxString initialText; wxString initialText;
wxNode *node = m_stringList->Add(initialText); wxNode *node = m_stringList->Add(initialText);
m_listBox->Append(initialText, (void *)node); m_listBox->Append(initialText, (void *)node);
m_currentSelection = m_stringList->Number() - 1; m_currentSelection = m_stringList->GetCount() - 1;
m_listBox->SetSelection(m_currentSelection); m_listBox->SetSelection(m_currentSelection);
ShowCurrentSelection(); ShowCurrentSelection();
m_stringText->SetFocus(); m_stringText->SetFocus();
@@ -1806,11 +1812,11 @@ void wxPropertyStringListEditorDialog::SaveCurrentSelection()
return; return;
wxString txt(m_stringText->GetValue()); wxString txt(m_stringText->GetValue());
if (node->Data()) if (node->GetData())
delete[] (wxChar *)node->Data(); delete[] (wxChar *)node->GetData();
node->SetData((wxObject *)wxStrdup(txt)); node->SetData((wxObject *)wxStrdup(txt));
m_listBox->SetString(m_currentSelection, (wxChar *)node->Data()); m_listBox->SetString(m_currentSelection, (wxChar *)node->GetData());
} }
void wxPropertyStringListEditorDialog::ShowCurrentSelection() void wxPropertyStringListEditorDialog::ShowCurrentSelection()
@@ -1821,7 +1827,7 @@ void wxPropertyStringListEditorDialog::ShowCurrentSelection()
return; return;
} }
wxNode *node = (wxNode *)m_listBox->wxListBox::GetClientData(m_currentSelection); wxNode *node = (wxNode *)m_listBox->wxListBox::GetClientData(m_currentSelection);
wxChar *txt = (wxChar *)node->Data(); wxChar *txt = (wxChar *)node->GetData();
m_stringText->SetValue(txt); m_stringText->SetValue(txt);
m_stringText->Enable(TRUE); m_stringText->Enable(TRUE);
} }

View File

@@ -617,9 +617,9 @@ void wxSashWindow::SizeWindows()
int cw, ch; int cw, ch;
GetClientSize(&cw, &ch); GetClientSize(&cw, &ch);
if (GetChildren().Number() == 1) if (GetChildren().GetCount() == 1)
{ {
wxWindow* child = (wxWindow*) (GetChildren().First()->Data()); wxWindow* child = GetChildren().GetFirst()->GetData();
int x = 0; int x = 0;
int y = 0; int y = 0;
@@ -658,7 +658,7 @@ void wxSashWindow::SizeWindows()
child->SetSize(x, y, width, height); child->SetSize(x, y, width, height);
} }
else if (GetChildren().Number() > 1) else if (GetChildren().GetCount() > 1)
{ {
// Perhaps multiple children are themselves sash windows. // Perhaps multiple children are themselves sash windows.
// TODO: this doesn't really work because the subwindows sizes/positions // TODO: this doesn't really work because the subwindows sizes/positions

View File

@@ -140,7 +140,7 @@ void wxTreeLayout::CalcLayout(long nodeId, int level, wxDC& dc)
{ {
wxList children; wxList children;
GetChildren(nodeId, children); GetChildren(nodeId, children);
int n = children.Number(); int n = children.GetCount();
if (m_orientation == FALSE) if (m_orientation == FALSE)
{ {
@@ -158,11 +158,11 @@ void wxTreeLayout::CalcLayout(long nodeId, int level, wxDC& dc)
SetNodeX(nodeId, (long)(GetNodeX(parentId) + m_xSpacing + x)); SetNodeX(nodeId, (long)(GetNodeX(parentId) + m_xSpacing + x));
} }
wxNode *node = children.First(); wxNode *node = children.GetFirst();
while (node) while (node)
{ {
CalcLayout((long)node->Data(), level+1, dc); CalcLayout((long)node->GetData(), level+1, dc);
node = node->Next(); node = node->GetNext();
} }
// Y Calculations // Y Calculations
@@ -172,11 +172,11 @@ void wxTreeLayout::CalcLayout(long nodeId, int level, wxDC& dc)
if (n > 0) if (n > 0)
{ {
averageY = 0; averageY = 0;
node = children.First(); node = children.GetFirst();
while (node) while (node)
{ {
averageY += GetNodeY((long)node->Data()); averageY += GetNodeY((long)node->GetData());
node = node->Next(); node = node->GetNext();
} }
averageY = averageY / n; averageY = averageY / n;
SetNodeY(nodeId, averageY); SetNodeY(nodeId, averageY);
@@ -207,11 +207,11 @@ void wxTreeLayout::CalcLayout(long nodeId, int level, wxDC& dc)
SetNodeY(nodeId, (long)(GetNodeY(parentId) + m_ySpacing + y)); SetNodeY(nodeId, (long)(GetNodeY(parentId) + m_ySpacing + y));
} }
wxNode *node = children.First(); wxNode *node = children.GetFirst();
while (node) while (node)
{ {
CalcLayout((long)node->Data(), level+1, dc); CalcLayout((long)node->GetData(), level+1, dc);
node = node->Next(); node = node->GetNext();
} }
// X Calculations // X Calculations
@@ -221,11 +221,11 @@ void wxTreeLayout::CalcLayout(long nodeId, int level, wxDC& dc)
if (n > 0) if (n > 0)
{ {
averageX = 0; averageX = 0;
node = children.First(); node = children.GetFirst();
while (node) while (node)
{ {
averageX += GetNodeX((long)node->Data()); averageX += GetNodeX((long)node->GetData());
node = node->Next(); node = node->GetNext();
} }
averageX = averageX / n; averageX = averageX / n;
SetNodeX(nodeId, averageX); SetNodeX(nodeId, averageX);

View File

@@ -237,7 +237,7 @@ static gint wxapp_idle_callback( gpointer WXUNUSED(data) )
// But repaint the assertion message if necessary // But repaint the assertion message if necessary
if (wxTopLevelWindows.GetCount() > 0) if (wxTopLevelWindows.GetCount() > 0)
{ {
wxWindow* win = (wxWindow*) wxTopLevelWindows.Last()->Data(); wxWindow* win = (wxWindow*) wxTopLevelWindows.GetLast()->GetData();
if (win->IsKindOf(CLASSINFO(wxGenericMessageDialog))) if (win->IsKindOf(CLASSINFO(wxGenericMessageDialog)))
win->OnInternalIdle(); win->OnInternalIdle();
} }
@@ -607,13 +607,13 @@ bool wxApp::CallInternalIdle( wxWindow* win )
{ {
win->OnInternalIdle(); win->OnInternalIdle();
wxNode* node = win->GetChildren().First(); wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindow* win = (wxWindow*) node->Data(); wxWindow *win = node->GetData();
CallInternalIdle( win );
node = node->Next(); CallInternalIdle( win );
node = node->GetNext();
} }
return TRUE; return TRUE;
@@ -631,14 +631,14 @@ bool wxApp::SendIdleEvents( wxWindow* win )
if (event.MoreRequested()) if (event.MoreRequested())
needMore = TRUE; needMore = TRUE;
wxNode* node = win->GetChildren().First(); wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindow* win = (wxWindow*) node->Data(); wxWindow *win = node->GetData();
if (SendIdleEvents(win)) if (SendIdleEvents(win))
needMore = TRUE; needMore = TRUE;
node = node->GetNext();
node = node->Next();
} }
return needMore; return needMore;
@@ -673,17 +673,17 @@ void wxApp::Dispatch()
void wxApp::DeletePendingObjects() void wxApp::DeletePendingObjects()
{ {
wxNode *node = wxPendingDelete.First(); wxNode *node = wxPendingDelete.GetFirst();
while (node) while (node)
{ {
wxObject *obj = (wxObject *)node->Data(); wxObject *obj = (wxObject *)node->GetData();
delete obj; delete obj;
if (wxPendingDelete.Find(obj)) if (wxPendingDelete.Find(obj))
delete node; delete node;
node = wxPendingDelete.First(); node = wxPendingDelete.GetFirst();
} }
} }

View File

@@ -143,7 +143,7 @@ void wxChoice::DoSetItemClientData( int n, void* clientData )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") ); wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientData") ); wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientData") );
node->SetData( (wxObject*) clientData ); node->SetData( (wxObject*) clientData );
@@ -153,17 +153,17 @@ void* wxChoice::DoGetItemClientData( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid choice control") ); wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid choice control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_MSG( node, NULL, wxT("invalid index in wxChoice::DoGetItemClientData") ); wxCHECK_MSG( node, NULL, wxT("invalid index in wxChoice::DoGetItemClientData") );
return node->Data(); return node->GetData();
} }
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData ) void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") ); wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientObject") ); wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientObject") );
// wxItemContainer already deletes data for us // wxItemContainer already deletes data for us
@@ -175,11 +175,11 @@ wxClientData* wxChoice::DoGetItemClientObject( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid choice control") ); wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid choice control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_MSG( node, (wxClientData *)NULL, wxCHECK_MSG( node, (wxClientData *)NULL,
wxT("invalid index in wxChoice::DoGetItemClientObject") ); wxT("invalid index in wxChoice::DoGetItemClientObject") );
return (wxClientData*) node->Data(); return (wxClientData*) node->GetData();
} }
void wxChoice::Clear() void wxChoice::Clear()
@@ -195,11 +195,11 @@ void wxChoice::Clear()
// destroy the data (due to Robert's idea of using wxList<wxObject> // destroy the data (due to Robert's idea of using wxList<wxObject>
// and not wxList<wxClientData> we can't just say // and not wxList<wxClientData> we can't just say
// m_clientList.DeleteContents(TRUE) - this would crash! // m_clientList.DeleteContents(TRUE) - this would crash!
wxNode *node = m_clientList.First(); wxNode *node = m_clientList.GetFirst();
while ( node ) while ( node )
{ {
delete (wxClientData *)node->Data(); delete (wxClientData *)node->GetData();
node = node->Next(); node = node->GetNext();
} }
} }
m_clientList.Clear(); m_clientList.Clear();

View File

@@ -160,7 +160,7 @@ void wxColour::InitFromName( const wxString &colourName )
wxNode *node = (wxNode *) NULL; wxNode *node = (wxNode *) NULL;
if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) ) if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
{ {
wxColour *col = (wxColour*)node->Data(); wxColour *col = (wxColour*)node->GetData();
UnRef(); UnRef();
if (col) Ref( *col ); if (col) Ref( *col );
} }

View File

@@ -197,12 +197,12 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
wxComboBox::~wxComboBox() wxComboBox::~wxComboBox()
{ {
wxNode *node = m_clientObjectList.First(); wxNode *node = m_clientObjectList.GetFirst();
while (node) while (node)
{ {
wxClientData *cd = (wxClientData*)node->Data(); wxClientData *cd = (wxClientData*)node->GetData();
if (cd) delete cd; if (cd) delete cd;
node = node->Next(); node = node->GetNext();
} }
m_clientObjectList.Clear(); m_clientObjectList.Clear();
@@ -272,7 +272,7 @@ void wxComboBox::SetClientData( int n, void* clientData )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n ); wxNode *node = m_clientDataList.Item( n );
if (!node) return; if (!node) return;
node->SetData( (wxObject*) clientData ); node->SetData( (wxObject*) clientData );
@@ -282,20 +282,20 @@ void* wxComboBox::GetClientData( int n )
{ {
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid combobox") ); wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n ); wxNode *node = m_clientDataList.Item( n );
if (!node) return NULL; if (!node) return NULL;
return node->Data(); return node->GetData();
} }
void wxComboBox::SetClientObject( int n, wxClientData* clientData ) void wxComboBox::SetClientObject( int n, wxClientData* clientData )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n ); wxNode *node = m_clientObjectList.Item( n );
if (!node) return; if (!node) return;
wxClientData *cd = (wxClientData*) node->Data(); wxClientData *cd = (wxClientData*) node->GetData();
if (cd) delete cd; if (cd) delete cd;
node->SetData( (wxObject*) clientData ); node->SetData( (wxObject*) clientData );
@@ -305,10 +305,10 @@ wxClientData* wxComboBox::GetClientObject( int n )
{ {
wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, wxT("invalid combobox") ); wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, wxT("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n ); wxNode *node = m_clientObjectList.Item( n );
if (!node) return (wxClientData*) NULL; if (!node) return (wxClientData*) NULL;
return (wxClientData*) node->Data(); return (wxClientData*) node->GetData();
} }
void wxComboBox::Clear() void wxComboBox::Clear()
@@ -318,12 +318,12 @@ void wxComboBox::Clear()
GtkWidget *list = GTK_COMBO(m_widget)->list; GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_clear_items( GTK_LIST(list), 0, Number() ); gtk_list_clear_items( GTK_LIST(list), 0, Number() );
wxNode *node = m_clientObjectList.First(); wxNode *node = m_clientObjectList.GetFirst();
while (node) while (node)
{ {
wxClientData *cd = (wxClientData*)node->Data(); wxClientData *cd = (wxClientData*)node->GetData();
if (cd) delete cd; if (cd) delete cd;
node = node->Next(); node = node->GetNext();
} }
m_clientObjectList.Clear(); m_clientObjectList.Clear();
@@ -348,15 +348,15 @@ void wxComboBox::Delete( int n )
gtk_list_remove_items( listbox, list ); gtk_list_remove_items( listbox, list );
g_list_free( list ); g_list_free( list );
wxNode *node = m_clientObjectList.Nth( n ); wxNode *node = m_clientObjectList.Item( n );
if (node) if (node)
{ {
wxClientData *cd = (wxClientData*)node->Data(); wxClientData *cd = (wxClientData*)node->GetData();
if (cd) delete cd; if (cd) delete cd;
m_clientObjectList.DeleteNode( node ); m_clientObjectList.DeleteNode( node );
} }
node = m_clientDataList.Nth( n ); node = m_clientDataList.Item( n );
if (node) if (node)
{ {
m_clientDataList.DeleteNode( node ); m_clientDataList.DeleteNode( node );

View File

@@ -447,7 +447,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
if (index != GetCount()) if (index != GetCount())
{ {
GtkAddItem( items[n], index ); GtkAddItem( items[n], index );
wxNode *node = m_clientList.Nth( index ); wxNode *node = m_clientList.Item( index );
m_clientList.Insert( node, (wxObject*) NULL ); m_clientList.Insert( node, (wxObject*) NULL );
} }
else else
@@ -470,7 +470,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
} }
else else
{ {
wxNode *node = m_clientList.Nth( pos ); wxNode *node = m_clientList.Item( pos );
for ( size_t n = 0; n < nItems; n++ ) for ( size_t n = 0; n < nItems; n++ )
{ {
GtkAddItem( items[n], pos+n ); GtkAddItem( items[n], pos+n );
@@ -496,7 +496,7 @@ int wxListBox::DoAppend( const wxString& item )
{ {
GtkAddItem( item, index ); GtkAddItem( item, index );
wxNode *node = m_clientList.Nth( index ); wxNode *node = m_clientList.Item( index );
m_clientList.Insert( node, (wxObject *)NULL ); m_clientList.Insert( node, (wxObject *)NULL );
return index; return index;
@@ -618,11 +618,11 @@ void wxListBox::Clear()
// destroy the data (due to Robert's idea of using wxList<wxObject> // destroy the data (due to Robert's idea of using wxList<wxObject>
// and not wxList<wxClientData> we can't just say // and not wxList<wxClientData> we can't just say
// m_clientList.DeleteContents(TRUE) - this would crash! // m_clientList.DeleteContents(TRUE) - this would crash!
wxNode *node = m_clientList.First(); wxNode *node = m_clientList.GetFirst();
while ( node ) while ( node )
{ {
delete (wxClientData *)node->Data(); delete (wxClientData *)node->GetData();
node = node->Next(); node = node->GetNext();
} }
} }
m_clientList.Clear(); m_clientList.Clear();
@@ -643,12 +643,12 @@ void wxListBox::Delete( int n )
gtk_list_remove_items( m_list, list ); gtk_list_remove_items( m_list, list );
g_list_free( list ); g_list_free( list );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
if ( node ) if ( node )
{ {
if ( m_clientDataItemsType == wxClientData_Object ) if ( m_clientDataItemsType == wxClientData_Object )
{ {
wxClientData *cd = (wxClientData*)node->Data(); wxClientData *cd = (wxClientData*)node->GetData();
delete cd; delete cd;
} }
@@ -667,7 +667,7 @@ void wxListBox::DoSetItemClientData( int n, void* clientData )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid listbox control") ); wxCHECK_RET( m_widget != NULL, wxT("invalid listbox control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_RET( node, wxT("invalid index in wxListBox::DoSetItemClientData") ); wxCHECK_RET( node, wxT("invalid index in wxListBox::DoSetItemClientData") );
node->SetData( (wxObject*) clientData ); node->SetData( (wxObject*) clientData );
@@ -677,17 +677,17 @@ void* wxListBox::DoGetItemClientData( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid listbox control") ); wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid listbox control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_MSG( node, NULL, wxT("invalid index in wxListBox::DoGetItemClientData") ); wxCHECK_MSG( node, NULL, wxT("invalid index in wxListBox::DoGetItemClientData") );
return node->Data(); return node->GetData();
} }
void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData ) void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid listbox control") ); wxCHECK_RET( m_widget != NULL, wxT("invalid listbox control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_RET( node, wxT("invalid index in wxListBox::DoSetItemClientObject") ); wxCHECK_RET( node, wxT("invalid index in wxListBox::DoSetItemClientObject") );
// wxItemContainer already deletes data for us // wxItemContainer already deletes data for us
@@ -699,11 +699,11 @@ wxClientData* wxListBox::DoGetItemClientObject( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid listbox control") ); wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid listbox control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_MSG( node, (wxClientData *)NULL, wxCHECK_MSG( node, (wxClientData *)NULL,
wxT("invalid index in wxListBox::DoGetItemClientObject") ); wxT("invalid index in wxListBox::DoGetItemClientObject") );
return (wxClientData*) node->Data(); return (wxClientData*) node->GetData();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -62,7 +62,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
wxMDIChildFrame *child = parent->GetActiveChild(); wxMDIChildFrame *child = parent->GetActiveChild();
if (child) if (child)
{ {
wxActivateEvent event1( wxEVT_ACTIVATE, FALSE, child->GetId() ); wxActivateEvent event1( wxEVT_ACTIVATE, false, child->GetId() );
event1.SetEventObject( child); event1.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event1 ); child->GetEventHandler()->ProcessEvent( event1 );
} }
@@ -75,22 +75,25 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
child = (wxMDIChildFrame*) NULL; child = (wxMDIChildFrame*) NULL;
wxNode *node = client_window->GetChildren().First(); wxWindowList::Node *node = client_window->GetChildren().GetFirst();
while (node) while (node)
{ {
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data(); wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
wxASSERT_MSG( child_frame, _T("child is not a wxMDIChildFrame") );
if (child_frame->m_page == page) if (child_frame->m_page == page)
{ {
child = child_frame; child = child_frame;
break; break;
} }
node = node->Next(); node = node->GetNext();
} }
if (!child) if (!child)
return; return;
wxActivateEvent event2( wxEVT_ACTIVATE, TRUE, child->GetId() ); wxActivateEvent event2( wxEVT_ACTIVATE, true, child->GetId() );
event2.SetEventObject( child); event2.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event2 ); child->GetEventHandler()->ProcessEvent( event2 );
} }
@@ -103,7 +106,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame,wxFrame)
void wxMDIParentFrame::Init() void wxMDIParentFrame::Init()
{ {
m_justInserted = FALSE; m_justInserted = false;
m_clientWindow = (wxMDIClientWindow *) NULL; m_clientWindow = (wxMDIClientWindow *) NULL;
} }
@@ -123,7 +126,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
OnCreateClient(); OnCreateClient();
return TRUE; return true;
} }
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height ) void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
@@ -158,20 +161,20 @@ void wxMDIParentFrame::OnInternalIdle()
GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget); GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget);
gtk_notebook_set_page( notebook, g_list_length( notebook->children ) - 1 ); gtk_notebook_set_page( notebook, g_list_length( notebook->children ) - 1 );
m_justInserted = FALSE; m_justInserted = false;
return; return;
} }
wxFrame::OnInternalIdle(); wxFrame::OnInternalIdle();
wxMDIChildFrame *active_child_frame = GetActiveChild(); wxMDIChildFrame *active_child_frame = GetActiveChild();
bool visible_child_menu = FALSE; bool visible_child_menu = false;
wxNode *node = m_clientWindow->GetChildren().First(); wxWindowList::Node *node = m_clientWindow->GetChildren().GetFirst();
while (node) while (node)
{ {
wxObject *child = node->Data(); wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
wxMDIChildFrame *child_frame = wxDynamicCast(child, wxMDIChildFrame);
if ( child_frame ) if ( child_frame )
{ {
wxMenuBar *menu_bar = child_frame->m_menuBar; wxMenuBar *menu_bar = child_frame->m_menuBar;
@@ -179,7 +182,7 @@ void wxMDIParentFrame::OnInternalIdle()
{ {
if (child_frame == active_child_frame) if (child_frame == active_child_frame)
{ {
if (menu_bar->Show(TRUE)) if (menu_bar->Show(true))
{ {
menu_bar->m_width = m_width; menu_bar->m_width = m_width;
menu_bar->m_height = wxMENU_HEIGHT; menu_bar->m_height = wxMENU_HEIGHT;
@@ -188,11 +191,11 @@ void wxMDIParentFrame::OnInternalIdle()
0, 0, m_width, wxMENU_HEIGHT ); 0, 0, m_width, wxMENU_HEIGHT );
menu_bar->SetInvokingWindow( child_frame ); menu_bar->SetInvokingWindow( child_frame );
} }
visible_child_menu = TRUE; visible_child_menu = true;
} }
else else
{ {
if (menu_bar->Show(FALSE)) if (menu_bar->Show(false))
{ {
menu_bar->UnsetInvokingWindow( child_frame ); menu_bar->UnsetInvokingWindow( child_frame );
} }
@@ -200,7 +203,7 @@ void wxMDIParentFrame::OnInternalIdle()
} }
} }
node = node->Next(); node = node->GetNext();
} }
/* show/hide parent menu bar as required */ /* show/hide parent menu bar as required */
@@ -209,12 +212,12 @@ void wxMDIParentFrame::OnInternalIdle()
{ {
if (visible_child_menu) if (visible_child_menu)
{ {
m_frameMenuBar->Show( FALSE ); m_frameMenuBar->Show( false );
m_frameMenuBar->UnsetInvokingWindow( this ); m_frameMenuBar->UnsetInvokingWindow( this );
} }
else else
{ {
m_frameMenuBar->Show( TRUE ); m_frameMenuBar->Show( true );
m_frameMenuBar->SetInvokingWindow( this ); m_frameMenuBar->SetInvokingWindow( this );
m_frameMenuBar->m_width = m_width; m_frameMenuBar->m_width = m_width;
@@ -244,13 +247,16 @@ wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
GtkNotebookPage* page = (GtkNotebookPage*) (g_list_nth(notebook->children,i)->data); GtkNotebookPage* page = (GtkNotebookPage*) (g_list_nth(notebook->children,i)->data);
if (!page) return (wxMDIChildFrame*) NULL; if (!page) return (wxMDIChildFrame*) NULL;
wxNode *node = m_clientWindow->GetChildren().First(); wxWindowList::Node *node = m_clientWindow->GetChildren().GetFirst();
while (node) while (node)
{ {
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data(); wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
wxASSERT_MSG( child_frame, _T("child is not a wxMDIChildFrame") );
if (child_frame->m_page == page) if (child_frame->m_page == page)
return child_frame; return child_frame;
node = node->Next(); node = node->GetNext();
} }
return (wxMDIChildFrame*) NULL; return (wxMDIChildFrame*) NULL;
@@ -445,7 +451,7 @@ static void wxInsertChildInMDI( wxMDIClientWindow* parent, wxMDIChildFrame* chil
child->m_page = (GtkNotebookPage*) (g_list_last(notebook->children)->data); child->m_page = (GtkNotebookPage*) (g_list_last(notebook->children)->data);
wxMDIParentFrame *parent_frame = (wxMDIParentFrame*) parent->GetParent(); wxMDIParentFrame *parent_frame = (wxMDIParentFrame*) parent->GetParent();
parent_frame->m_justInserted = TRUE; parent_frame->m_justInserted = true;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -469,7 +475,7 @@ wxMDIClientWindow::~wxMDIClientWindow()
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style ) bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
{ {
m_needParent = TRUE; m_needParent = true;
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI; m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
@@ -477,7 +483,7 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") )) !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") ))
{ {
wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") ); wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") );
return FALSE; return false;
} }
m_widget = gtk_notebook_new(); m_widget = gtk_notebook_new();
@@ -491,9 +497,9 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
PostCreation(); PostCreation();
Show( TRUE ); Show( true );
return TRUE; return true;
} }
#endif #endif

View File

@@ -1323,13 +1323,13 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
{ {
wxNode *node = m_items.First(); wxMenuItemList::Node *node = m_items.GetFirst();
while (node) while (node)
{ {
wxMenuItem *item = (wxMenuItem*)node->Data(); wxMenuItem *item = node->GetData();
if (item->GetMenuItem() == menuItem) if (item->GetMenuItem() == menuItem)
return item->GetId(); return item->GetId();
node = node->Next(); node = node->GetNext();
} }
return wxNOT_FOUND; return wxNOT_FOUND;

View File

@@ -91,20 +91,20 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_
if ((gdk_event->keyval == GDK_Up) || if ((gdk_event->keyval == GDK_Up) ||
(gdk_event->keyval == GDK_Left)) (gdk_event->keyval == GDK_Left))
{ {
if (node == rb->m_boxes.First()) if (node == rb->m_boxes.GetFirst())
node = rb->m_boxes.Last(); node = rb->m_boxes.GetLast();
else else
node = node->Previous(); node = node->GetPrevious();
} }
else else
{ {
if (node == rb->m_boxes.Last()) if (node == rb->m_boxes.GetLast())
node = rb->m_boxes.First(); node = rb->m_boxes.GetFirst();
else else
node = node->Next(); node = node->GetNext();
} }
GtkWidget *button = (GtkWidget*) node->Data(); GtkWidget *button = (GtkWidget*) node->GetData();
gtk_widget_grab_focus( button ); gtk_widget_grab_focus( button );
@@ -260,12 +260,12 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
wxRadioBox::~wxRadioBox() wxRadioBox::~wxRadioBox()
{ {
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
gtk_widget_destroy( button ); gtk_widget_destroy( button );
node = node->Next(); node = node->GetNext();
} }
} }
@@ -314,10 +314,10 @@ wxSize wxRadioBox::LayoutItems()
y = 15; y = 15;
int max_len = 0; int max_len = 0;
wxNode *node = m_boxes.Nth( j*num_of_rows ); wxNode *node = m_boxes.Item( j*num_of_rows );
for (int i1 = 0; i1< num_of_rows; i1++) for (int i1 = 0; i1< num_of_rows; i1++)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
GtkRequisition req; GtkRequisition req;
req.width = 2; req.width = 2;
@@ -330,20 +330,20 @@ wxSize wxRadioBox::LayoutItems()
gtk_pizza_move( GTK_PIZZA(m_parent->m_wxwindow), button, m_x+x, m_y+y ); gtk_pizza_move( GTK_PIZZA(m_parent->m_wxwindow), button, m_x+x, m_y+y );
y += req.height; y += req.height;
node = node->Next(); node = node->GetNext();
if (!node) break; if (!node) break;
} }
// we don't know the max_len before // we don't know the max_len before
node = m_boxes.Nth( j*num_of_rows ); node = m_boxes.Item( j*num_of_rows );
for (int i2 = 0; i2< num_of_rows; i2++) for (int i2 = 0; i2< num_of_rows; i2++)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
gtk_pizza_resize( GTK_PIZZA(m_parent->m_wxwindow), button, max_len, 20 ); gtk_pizza_resize( GTK_PIZZA(m_parent->m_wxwindow), button, max_len, 20 );
node = node->Next(); node = node->GetNext();
if (!node) break; if (!node) break;
} }
@@ -359,10 +359,10 @@ wxSize wxRadioBox::LayoutItems()
{ {
int max = 0; int max = 0;
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
GtkRequisition req; GtkRequisition req;
req.width = 2; req.width = 2;
@@ -372,18 +372,18 @@ wxSize wxRadioBox::LayoutItems()
if (req.width > max) max = req.width; if (req.width > max) max = req.width;
node = node->Next(); node = node->GetNext();
} }
node = m_boxes.First(); node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
gtk_pizza_set_size( GTK_PIZZA(m_parent->m_wxwindow), button, m_x+x, m_y+y, max, 20 ); gtk_pizza_set_size( GTK_PIZZA(m_parent->m_wxwindow), button, m_x+x, m_y+y, max, 20 );
x += max; x += max;
node = node->Next(); node = node->GetNext();
} }
res.x = x+4; res.x = x+4;
res.y = 40; res.y = 40;
@@ -405,14 +405,14 @@ bool wxRadioBox::Show( bool show )
if ((m_windowStyle & wxNO_BORDER) != 0) if ((m_windowStyle & wxNO_BORDER) != 0)
gtk_widget_hide( m_widget ); gtk_widget_hide( m_widget );
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
if (show) gtk_widget_show( button ); else gtk_widget_hide( button ); if (show) gtk_widget_show( button ); else gtk_widget_hide( button );
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
@@ -424,10 +424,10 @@ int wxRadioBox::FindString( const wxString &find ) const
int count = 0; int count = 0;
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) ); GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
#ifdef __WXGTK20__ #ifdef __WXGTK20__
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) ); wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
#else #else
@@ -438,7 +438,7 @@ int wxRadioBox::FindString( const wxString &find ) const
count++; count++;
node = node->Next(); node = node->GetNext();
} }
return -1; return -1;
@@ -450,16 +450,16 @@ void wxRadioBox::SetFocus()
if (m_boxes.GetCount() == 0) return; if (m_boxes.GetCount() == 0) return;
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
if (button->active) if (button->active)
{ {
gtk_widget_grab_focus( GTK_WIDGET(button) ); gtk_widget_grab_focus( GTK_WIDGET(button) );
return; return;
} }
node = node->Next(); node = node->GetNext();
} }
} }
@@ -467,11 +467,11 @@ void wxRadioBox::SetSelection( int n )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
wxNode *node = m_boxes.Nth( n ); wxNode *node = m_boxes.Item( n );
wxCHECK_RET( node, wxT("radiobox wrong index") ); wxCHECK_RET( node, wxT("radiobox wrong index") );
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
GtkDisableEvents(); GtkDisableEvents();
@@ -486,13 +486,13 @@ int wxRadioBox::GetSelection(void) const
int count = 0; int count = 0;
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
if (button->active) return count; if (button->active) return count;
count++; count++;
node = node->Next(); node = node->GetNext();
} }
wxFAIL_MSG( wxT("wxRadioBox none selected") ); wxFAIL_MSG( wxT("wxRadioBox none selected") );
@@ -504,11 +504,11 @@ wxString wxRadioBox::GetString( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") ); wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") );
wxNode *node = m_boxes.Nth( n ); wxNode *node = m_boxes.Item( n );
wxCHECK_MSG( node, wxT(""), wxT("radiobox wrong index") ); wxCHECK_MSG( node, wxT(""), wxT("radiobox wrong index") );
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) ); GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
#ifdef __WXGTK20__ #ifdef __WXGTK20__
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) ); wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
@@ -532,11 +532,11 @@ void wxRadioBox::SetString( int item, const wxString& label )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
wxNode *node = m_boxes.Nth( item ); wxNode *node = m_boxes.Item( item );
wxCHECK_RET( node, wxT("radiobox wrong index") ); wxCHECK_RET( node, wxT("radiobox wrong index") );
GtkLabel *g_label = GTK_LABEL( BUTTON_CHILD(node->Data()) ); GtkLabel *g_label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
gtk_label_set( g_label, wxGTK_CONV( label ) ); gtk_label_set( g_label, wxGTK_CONV( label ) );
} }
@@ -546,15 +546,15 @@ bool wxRadioBox::Enable( bool enable )
if ( !wxControl::Enable( enable ) ) if ( !wxControl::Enable( enable ) )
return FALSE; return FALSE;
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkButton *button = GTK_BUTTON( node->Data() ); GtkButton *button = GTK_BUTTON( node->GetData() );
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) ); GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
gtk_widget_set_sensitive( GTK_WIDGET(button), enable ); gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
gtk_widget_set_sensitive( GTK_WIDGET(label), enable ); gtk_widget_set_sensitive( GTK_WIDGET(label), enable );
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
@@ -564,11 +564,11 @@ void wxRadioBox::Enable( int item, bool enable )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
wxNode *node = m_boxes.Nth( item ); wxNode *node = m_boxes.Item( item );
wxCHECK_RET( node, wxT("radiobox wrong index") ); wxCHECK_RET( node, wxT("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() ); GtkButton *button = GTK_BUTTON( node->GetData() );
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) ); GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
gtk_widget_set_sensitive( GTK_WIDGET(button), enable ); gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
@@ -579,11 +579,11 @@ void wxRadioBox::Show( int item, bool show )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
wxNode *node = m_boxes.Nth( item ); wxNode *node = m_boxes.Item( item );
wxCHECK_RET( node, wxT("radiobox wrong index") ); wxCHECK_RET( node, wxT("radiobox wrong index") );
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
if (show) if (show)
gtk_widget_show( button ); gtk_widget_show( button );
@@ -595,13 +595,13 @@ wxString wxRadioBox::GetStringSelection() const
{ {
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") ); wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") );
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
if (button->active) if (button->active)
{ {
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) ); GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
#ifdef __WXGTK20__ #ifdef __WXGTK20__
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) ); wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
@@ -610,7 +610,7 @@ wxString wxRadioBox::GetStringSelection() const
#endif #endif
return str; return str;
} }
node = node->Next(); node = node->GetNext();
} }
wxFAIL_MSG( wxT("wxRadioBox none selected") ); wxFAIL_MSG( wxT("wxRadioBox none selected") );
@@ -630,7 +630,7 @@ bool wxRadioBox::SetStringSelection( const wxString &s )
int wxRadioBox::GetCount() const int wxRadioBox::GetCount() const
{ {
return m_boxes.Number(); return m_boxes.GetCount();
} }
int wxRadioBox::GetNumberOfRowsOrCols() const int wxRadioBox::GetNumberOfRowsOrCols() const
@@ -645,25 +645,25 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
void wxRadioBox::GtkDisableEvents() void wxRadioBox::GtkDisableEvents()
{ {
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
gtk_signal_disconnect_by_func( GTK_OBJECT(node->Data()), gtk_signal_disconnect_by_func( GTK_OBJECT(node->GetData()),
GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
node = node->Next(); node = node->GetNext();
} }
} }
void wxRadioBox::GtkEnableEvents() void wxRadioBox::GtkEnableEvents()
{ {
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
gtk_signal_connect( GTK_OBJECT(node->Data()), "clicked", gtk_signal_connect( GTK_OBJECT(node->GetData()), "clicked",
GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
node = node->Next(); node = node->GetNext();
} }
} }
@@ -673,27 +673,27 @@ void wxRadioBox::ApplyWidgetStyle()
gtk_widget_set_style( m_widget, m_widgetStyle ); gtk_widget_set_style( m_widget, m_widgetStyle );
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *widget = GTK_WIDGET( node->Data() ); GtkWidget *widget = GTK_WIDGET( node->GetData() );
gtk_widget_set_style( widget, m_widgetStyle ); gtk_widget_set_style( widget, m_widgetStyle );
gtk_widget_set_style( BUTTON_CHILD(node->Data()), m_widgetStyle ); gtk_widget_set_style( BUTTON_CHILD(node->GetData()), m_widgetStyle );
node = node->Next(); node = node->GetNext();
} }
} }
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS
void wxRadioBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip ) void wxRadioBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
{ {
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *widget = GTK_WIDGET( node->Data() ); GtkWidget *widget = GTK_WIDGET( node->GetData() );
gtk_tooltips_set_tip( tips, widget, wxConvCurrent->cWX2MB(tip), (gchar*) NULL ); gtk_tooltips_set_tip( tips, widget, wxConvCurrent->cWX2MB(tip), (gchar*) NULL );
node = node->Next(); node = node->GetNext();
} }
} }
#endif // wxUSE_TOOLTIPS #endif // wxUSE_TOOLTIPS
@@ -702,14 +702,14 @@ bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window )
{ {
if (window == m_widget->window) return TRUE; if (window == m_widget->window) return TRUE;
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
if (window == button->window) return TRUE; if (window == button->window) return TRUE;
node = node->Next(); node = node->GetNext();
} }
return FALSE; return FALSE;

View File

@@ -1511,12 +1511,12 @@ wxWindowGTK *FindWindowForMouseEvent(wxWindowGTK *win, wxCoord& x, wxCoord& y)
yy += pizza->yoffset; yy += pizza->yoffset;
} }
wxNode *node = win->GetChildren().First(); wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindowGTK *child = (wxWindowGTK*)node->Data(); wxWindowGTK *child = node->GetData();
node = node->Next(); node = node->GetNext();
if (!child->IsShown()) if (!child->IsShown())
continue; continue;

View File

@@ -237,7 +237,7 @@ static gint wxapp_idle_callback( gpointer WXUNUSED(data) )
// But repaint the assertion message if necessary // But repaint the assertion message if necessary
if (wxTopLevelWindows.GetCount() > 0) if (wxTopLevelWindows.GetCount() > 0)
{ {
wxWindow* win = (wxWindow*) wxTopLevelWindows.Last()->Data(); wxWindow* win = (wxWindow*) wxTopLevelWindows.GetLast()->GetData();
if (win->IsKindOf(CLASSINFO(wxGenericMessageDialog))) if (win->IsKindOf(CLASSINFO(wxGenericMessageDialog)))
win->OnInternalIdle(); win->OnInternalIdle();
} }
@@ -607,13 +607,13 @@ bool wxApp::CallInternalIdle( wxWindow* win )
{ {
win->OnInternalIdle(); win->OnInternalIdle();
wxNode* node = win->GetChildren().First(); wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindow* win = (wxWindow*) node->Data(); wxWindow *win = node->GetData();
CallInternalIdle( win );
node = node->Next(); CallInternalIdle( win );
node = node->GetNext();
} }
return TRUE; return TRUE;
@@ -631,14 +631,14 @@ bool wxApp::SendIdleEvents( wxWindow* win )
if (event.MoreRequested()) if (event.MoreRequested())
needMore = TRUE; needMore = TRUE;
wxNode* node = win->GetChildren().First(); wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindow* win = (wxWindow*) node->Data(); wxWindow *win = node->GetData();
if (SendIdleEvents(win)) if (SendIdleEvents(win))
needMore = TRUE; needMore = TRUE;
node = node->GetNext();
node = node->Next();
} }
return needMore; return needMore;
@@ -673,17 +673,17 @@ void wxApp::Dispatch()
void wxApp::DeletePendingObjects() void wxApp::DeletePendingObjects()
{ {
wxNode *node = wxPendingDelete.First(); wxNode *node = wxPendingDelete.GetFirst();
while (node) while (node)
{ {
wxObject *obj = (wxObject *)node->Data(); wxObject *obj = (wxObject *)node->GetData();
delete obj; delete obj;
if (wxPendingDelete.Find(obj)) if (wxPendingDelete.Find(obj))
delete node; delete node;
node = wxPendingDelete.First(); node = wxPendingDelete.GetFirst();
} }
} }

View File

@@ -143,7 +143,7 @@ void wxChoice::DoSetItemClientData( int n, void* clientData )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") ); wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientData") ); wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientData") );
node->SetData( (wxObject*) clientData ); node->SetData( (wxObject*) clientData );
@@ -153,17 +153,17 @@ void* wxChoice::DoGetItemClientData( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid choice control") ); wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid choice control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_MSG( node, NULL, wxT("invalid index in wxChoice::DoGetItemClientData") ); wxCHECK_MSG( node, NULL, wxT("invalid index in wxChoice::DoGetItemClientData") );
return node->Data(); return node->GetData();
} }
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData ) void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") ); wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientObject") ); wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientObject") );
// wxItemContainer already deletes data for us // wxItemContainer already deletes data for us
@@ -175,11 +175,11 @@ wxClientData* wxChoice::DoGetItemClientObject( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid choice control") ); wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid choice control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_MSG( node, (wxClientData *)NULL, wxCHECK_MSG( node, (wxClientData *)NULL,
wxT("invalid index in wxChoice::DoGetItemClientObject") ); wxT("invalid index in wxChoice::DoGetItemClientObject") );
return (wxClientData*) node->Data(); return (wxClientData*) node->GetData();
} }
void wxChoice::Clear() void wxChoice::Clear()
@@ -195,11 +195,11 @@ void wxChoice::Clear()
// destroy the data (due to Robert's idea of using wxList<wxObject> // destroy the data (due to Robert's idea of using wxList<wxObject>
// and not wxList<wxClientData> we can't just say // and not wxList<wxClientData> we can't just say
// m_clientList.DeleteContents(TRUE) - this would crash! // m_clientList.DeleteContents(TRUE) - this would crash!
wxNode *node = m_clientList.First(); wxNode *node = m_clientList.GetFirst();
while ( node ) while ( node )
{ {
delete (wxClientData *)node->Data(); delete (wxClientData *)node->GetData();
node = node->Next(); node = node->GetNext();
} }
} }
m_clientList.Clear(); m_clientList.Clear();

View File

@@ -160,7 +160,7 @@ void wxColour::InitFromName( const wxString &colourName )
wxNode *node = (wxNode *) NULL; wxNode *node = (wxNode *) NULL;
if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) ) if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
{ {
wxColour *col = (wxColour*)node->Data(); wxColour *col = (wxColour*)node->GetData();
UnRef(); UnRef();
if (col) Ref( *col ); if (col) Ref( *col );
} }

View File

@@ -197,12 +197,12 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
wxComboBox::~wxComboBox() wxComboBox::~wxComboBox()
{ {
wxNode *node = m_clientObjectList.First(); wxNode *node = m_clientObjectList.GetFirst();
while (node) while (node)
{ {
wxClientData *cd = (wxClientData*)node->Data(); wxClientData *cd = (wxClientData*)node->GetData();
if (cd) delete cd; if (cd) delete cd;
node = node->Next(); node = node->GetNext();
} }
m_clientObjectList.Clear(); m_clientObjectList.Clear();
@@ -272,7 +272,7 @@ void wxComboBox::SetClientData( int n, void* clientData )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n ); wxNode *node = m_clientDataList.Item( n );
if (!node) return; if (!node) return;
node->SetData( (wxObject*) clientData ); node->SetData( (wxObject*) clientData );
@@ -282,20 +282,20 @@ void* wxComboBox::GetClientData( int n )
{ {
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid combobox") ); wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n ); wxNode *node = m_clientDataList.Item( n );
if (!node) return NULL; if (!node) return NULL;
return node->Data(); return node->GetData();
} }
void wxComboBox::SetClientObject( int n, wxClientData* clientData ) void wxComboBox::SetClientObject( int n, wxClientData* clientData )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n ); wxNode *node = m_clientObjectList.Item( n );
if (!node) return; if (!node) return;
wxClientData *cd = (wxClientData*) node->Data(); wxClientData *cd = (wxClientData*) node->GetData();
if (cd) delete cd; if (cd) delete cd;
node->SetData( (wxObject*) clientData ); node->SetData( (wxObject*) clientData );
@@ -305,10 +305,10 @@ wxClientData* wxComboBox::GetClientObject( int n )
{ {
wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, wxT("invalid combobox") ); wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, wxT("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n ); wxNode *node = m_clientObjectList.Item( n );
if (!node) return (wxClientData*) NULL; if (!node) return (wxClientData*) NULL;
return (wxClientData*) node->Data(); return (wxClientData*) node->GetData();
} }
void wxComboBox::Clear() void wxComboBox::Clear()
@@ -318,12 +318,12 @@ void wxComboBox::Clear()
GtkWidget *list = GTK_COMBO(m_widget)->list; GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_clear_items( GTK_LIST(list), 0, Number() ); gtk_list_clear_items( GTK_LIST(list), 0, Number() );
wxNode *node = m_clientObjectList.First(); wxNode *node = m_clientObjectList.GetFirst();
while (node) while (node)
{ {
wxClientData *cd = (wxClientData*)node->Data(); wxClientData *cd = (wxClientData*)node->GetData();
if (cd) delete cd; if (cd) delete cd;
node = node->Next(); node = node->GetNext();
} }
m_clientObjectList.Clear(); m_clientObjectList.Clear();
@@ -348,15 +348,15 @@ void wxComboBox::Delete( int n )
gtk_list_remove_items( listbox, list ); gtk_list_remove_items( listbox, list );
g_list_free( list ); g_list_free( list );
wxNode *node = m_clientObjectList.Nth( n ); wxNode *node = m_clientObjectList.Item( n );
if (node) if (node)
{ {
wxClientData *cd = (wxClientData*)node->Data(); wxClientData *cd = (wxClientData*)node->GetData();
if (cd) delete cd; if (cd) delete cd;
m_clientObjectList.DeleteNode( node ); m_clientObjectList.DeleteNode( node );
} }
node = m_clientDataList.Nth( n ); node = m_clientDataList.Item( n );
if (node) if (node)
{ {
m_clientDataList.DeleteNode( node ); m_clientDataList.DeleteNode( node );

View File

@@ -447,7 +447,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
if (index != GetCount()) if (index != GetCount())
{ {
GtkAddItem( items[n], index ); GtkAddItem( items[n], index );
wxNode *node = m_clientList.Nth( index ); wxNode *node = m_clientList.Item( index );
m_clientList.Insert( node, (wxObject*) NULL ); m_clientList.Insert( node, (wxObject*) NULL );
} }
else else
@@ -470,7 +470,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
} }
else else
{ {
wxNode *node = m_clientList.Nth( pos ); wxNode *node = m_clientList.Item( pos );
for ( size_t n = 0; n < nItems; n++ ) for ( size_t n = 0; n < nItems; n++ )
{ {
GtkAddItem( items[n], pos+n ); GtkAddItem( items[n], pos+n );
@@ -496,7 +496,7 @@ int wxListBox::DoAppend( const wxString& item )
{ {
GtkAddItem( item, index ); GtkAddItem( item, index );
wxNode *node = m_clientList.Nth( index ); wxNode *node = m_clientList.Item( index );
m_clientList.Insert( node, (wxObject *)NULL ); m_clientList.Insert( node, (wxObject *)NULL );
return index; return index;
@@ -618,11 +618,11 @@ void wxListBox::Clear()
// destroy the data (due to Robert's idea of using wxList<wxObject> // destroy the data (due to Robert's idea of using wxList<wxObject>
// and not wxList<wxClientData> we can't just say // and not wxList<wxClientData> we can't just say
// m_clientList.DeleteContents(TRUE) - this would crash! // m_clientList.DeleteContents(TRUE) - this would crash!
wxNode *node = m_clientList.First(); wxNode *node = m_clientList.GetFirst();
while ( node ) while ( node )
{ {
delete (wxClientData *)node->Data(); delete (wxClientData *)node->GetData();
node = node->Next(); node = node->GetNext();
} }
} }
m_clientList.Clear(); m_clientList.Clear();
@@ -643,12 +643,12 @@ void wxListBox::Delete( int n )
gtk_list_remove_items( m_list, list ); gtk_list_remove_items( m_list, list );
g_list_free( list ); g_list_free( list );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
if ( node ) if ( node )
{ {
if ( m_clientDataItemsType == wxClientData_Object ) if ( m_clientDataItemsType == wxClientData_Object )
{ {
wxClientData *cd = (wxClientData*)node->Data(); wxClientData *cd = (wxClientData*)node->GetData();
delete cd; delete cd;
} }
@@ -667,7 +667,7 @@ void wxListBox::DoSetItemClientData( int n, void* clientData )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid listbox control") ); wxCHECK_RET( m_widget != NULL, wxT("invalid listbox control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_RET( node, wxT("invalid index in wxListBox::DoSetItemClientData") ); wxCHECK_RET( node, wxT("invalid index in wxListBox::DoSetItemClientData") );
node->SetData( (wxObject*) clientData ); node->SetData( (wxObject*) clientData );
@@ -677,17 +677,17 @@ void* wxListBox::DoGetItemClientData( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid listbox control") ); wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid listbox control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_MSG( node, NULL, wxT("invalid index in wxListBox::DoGetItemClientData") ); wxCHECK_MSG( node, NULL, wxT("invalid index in wxListBox::DoGetItemClientData") );
return node->Data(); return node->GetData();
} }
void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData ) void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid listbox control") ); wxCHECK_RET( m_widget != NULL, wxT("invalid listbox control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_RET( node, wxT("invalid index in wxListBox::DoSetItemClientObject") ); wxCHECK_RET( node, wxT("invalid index in wxListBox::DoSetItemClientObject") );
// wxItemContainer already deletes data for us // wxItemContainer already deletes data for us
@@ -699,11 +699,11 @@ wxClientData* wxListBox::DoGetItemClientObject( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid listbox control") ); wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid listbox control") );
wxNode *node = m_clientList.Nth( n ); wxNode *node = m_clientList.Item( n );
wxCHECK_MSG( node, (wxClientData *)NULL, wxCHECK_MSG( node, (wxClientData *)NULL,
wxT("invalid index in wxListBox::DoGetItemClientObject") ); wxT("invalid index in wxListBox::DoGetItemClientObject") );
return (wxClientData*) node->Data(); return (wxClientData*) node->GetData();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -62,7 +62,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
wxMDIChildFrame *child = parent->GetActiveChild(); wxMDIChildFrame *child = parent->GetActiveChild();
if (child) if (child)
{ {
wxActivateEvent event1( wxEVT_ACTIVATE, FALSE, child->GetId() ); wxActivateEvent event1( wxEVT_ACTIVATE, false, child->GetId() );
event1.SetEventObject( child); event1.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event1 ); child->GetEventHandler()->ProcessEvent( event1 );
} }
@@ -75,22 +75,25 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
child = (wxMDIChildFrame*) NULL; child = (wxMDIChildFrame*) NULL;
wxNode *node = client_window->GetChildren().First(); wxWindowList::Node *node = client_window->GetChildren().GetFirst();
while (node) while (node)
{ {
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data(); wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
wxASSERT_MSG( child_frame, _T("child is not a wxMDIChildFrame") );
if (child_frame->m_page == page) if (child_frame->m_page == page)
{ {
child = child_frame; child = child_frame;
break; break;
} }
node = node->Next(); node = node->GetNext();
} }
if (!child) if (!child)
return; return;
wxActivateEvent event2( wxEVT_ACTIVATE, TRUE, child->GetId() ); wxActivateEvent event2( wxEVT_ACTIVATE, true, child->GetId() );
event2.SetEventObject( child); event2.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event2 ); child->GetEventHandler()->ProcessEvent( event2 );
} }
@@ -103,7 +106,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame,wxFrame)
void wxMDIParentFrame::Init() void wxMDIParentFrame::Init()
{ {
m_justInserted = FALSE; m_justInserted = false;
m_clientWindow = (wxMDIClientWindow *) NULL; m_clientWindow = (wxMDIClientWindow *) NULL;
} }
@@ -123,7 +126,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
OnCreateClient(); OnCreateClient();
return TRUE; return true;
} }
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height ) void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
@@ -158,20 +161,20 @@ void wxMDIParentFrame::OnInternalIdle()
GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget); GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget);
gtk_notebook_set_page( notebook, g_list_length( notebook->children ) - 1 ); gtk_notebook_set_page( notebook, g_list_length( notebook->children ) - 1 );
m_justInserted = FALSE; m_justInserted = false;
return; return;
} }
wxFrame::OnInternalIdle(); wxFrame::OnInternalIdle();
wxMDIChildFrame *active_child_frame = GetActiveChild(); wxMDIChildFrame *active_child_frame = GetActiveChild();
bool visible_child_menu = FALSE; bool visible_child_menu = false;
wxNode *node = m_clientWindow->GetChildren().First(); wxWindowList::Node *node = m_clientWindow->GetChildren().GetFirst();
while (node) while (node)
{ {
wxObject *child = node->Data(); wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
wxMDIChildFrame *child_frame = wxDynamicCast(child, wxMDIChildFrame);
if ( child_frame ) if ( child_frame )
{ {
wxMenuBar *menu_bar = child_frame->m_menuBar; wxMenuBar *menu_bar = child_frame->m_menuBar;
@@ -179,7 +182,7 @@ void wxMDIParentFrame::OnInternalIdle()
{ {
if (child_frame == active_child_frame) if (child_frame == active_child_frame)
{ {
if (menu_bar->Show(TRUE)) if (menu_bar->Show(true))
{ {
menu_bar->m_width = m_width; menu_bar->m_width = m_width;
menu_bar->m_height = wxMENU_HEIGHT; menu_bar->m_height = wxMENU_HEIGHT;
@@ -188,11 +191,11 @@ void wxMDIParentFrame::OnInternalIdle()
0, 0, m_width, wxMENU_HEIGHT ); 0, 0, m_width, wxMENU_HEIGHT );
menu_bar->SetInvokingWindow( child_frame ); menu_bar->SetInvokingWindow( child_frame );
} }
visible_child_menu = TRUE; visible_child_menu = true;
} }
else else
{ {
if (menu_bar->Show(FALSE)) if (menu_bar->Show(false))
{ {
menu_bar->UnsetInvokingWindow( child_frame ); menu_bar->UnsetInvokingWindow( child_frame );
} }
@@ -200,7 +203,7 @@ void wxMDIParentFrame::OnInternalIdle()
} }
} }
node = node->Next(); node = node->GetNext();
} }
/* show/hide parent menu bar as required */ /* show/hide parent menu bar as required */
@@ -209,12 +212,12 @@ void wxMDIParentFrame::OnInternalIdle()
{ {
if (visible_child_menu) if (visible_child_menu)
{ {
m_frameMenuBar->Show( FALSE ); m_frameMenuBar->Show( false );
m_frameMenuBar->UnsetInvokingWindow( this ); m_frameMenuBar->UnsetInvokingWindow( this );
} }
else else
{ {
m_frameMenuBar->Show( TRUE ); m_frameMenuBar->Show( true );
m_frameMenuBar->SetInvokingWindow( this ); m_frameMenuBar->SetInvokingWindow( this );
m_frameMenuBar->m_width = m_width; m_frameMenuBar->m_width = m_width;
@@ -244,13 +247,16 @@ wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
GtkNotebookPage* page = (GtkNotebookPage*) (g_list_nth(notebook->children,i)->data); GtkNotebookPage* page = (GtkNotebookPage*) (g_list_nth(notebook->children,i)->data);
if (!page) return (wxMDIChildFrame*) NULL; if (!page) return (wxMDIChildFrame*) NULL;
wxNode *node = m_clientWindow->GetChildren().First(); wxWindowList::Node *node = m_clientWindow->GetChildren().GetFirst();
while (node) while (node)
{ {
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data(); wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
wxASSERT_MSG( child_frame, _T("child is not a wxMDIChildFrame") );
if (child_frame->m_page == page) if (child_frame->m_page == page)
return child_frame; return child_frame;
node = node->Next(); node = node->GetNext();
} }
return (wxMDIChildFrame*) NULL; return (wxMDIChildFrame*) NULL;
@@ -445,7 +451,7 @@ static void wxInsertChildInMDI( wxMDIClientWindow* parent, wxMDIChildFrame* chil
child->m_page = (GtkNotebookPage*) (g_list_last(notebook->children)->data); child->m_page = (GtkNotebookPage*) (g_list_last(notebook->children)->data);
wxMDIParentFrame *parent_frame = (wxMDIParentFrame*) parent->GetParent(); wxMDIParentFrame *parent_frame = (wxMDIParentFrame*) parent->GetParent();
parent_frame->m_justInserted = TRUE; parent_frame->m_justInserted = true;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -469,7 +475,7 @@ wxMDIClientWindow::~wxMDIClientWindow()
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style ) bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
{ {
m_needParent = TRUE; m_needParent = true;
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI; m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
@@ -477,7 +483,7 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") )) !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") ))
{ {
wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") ); wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") );
return FALSE; return false;
} }
m_widget = gtk_notebook_new(); m_widget = gtk_notebook_new();
@@ -491,9 +497,9 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
PostCreation(); PostCreation();
Show( TRUE ); Show( true );
return TRUE; return true;
} }
#endif #endif

View File

@@ -1323,13 +1323,13 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
{ {
wxNode *node = m_items.First(); wxMenuItemList::Node *node = m_items.GetFirst();
while (node) while (node)
{ {
wxMenuItem *item = (wxMenuItem*)node->Data(); wxMenuItem *item = node->GetData();
if (item->GetMenuItem() == menuItem) if (item->GetMenuItem() == menuItem)
return item->GetId(); return item->GetId();
node = node->Next(); node = node->GetNext();
} }
return wxNOT_FOUND; return wxNOT_FOUND;

View File

@@ -91,20 +91,20 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_
if ((gdk_event->keyval == GDK_Up) || if ((gdk_event->keyval == GDK_Up) ||
(gdk_event->keyval == GDK_Left)) (gdk_event->keyval == GDK_Left))
{ {
if (node == rb->m_boxes.First()) if (node == rb->m_boxes.GetFirst())
node = rb->m_boxes.Last(); node = rb->m_boxes.GetLast();
else else
node = node->Previous(); node = node->GetPrevious();
} }
else else
{ {
if (node == rb->m_boxes.Last()) if (node == rb->m_boxes.GetLast())
node = rb->m_boxes.First(); node = rb->m_boxes.GetFirst();
else else
node = node->Next(); node = node->GetNext();
} }
GtkWidget *button = (GtkWidget*) node->Data(); GtkWidget *button = (GtkWidget*) node->GetData();
gtk_widget_grab_focus( button ); gtk_widget_grab_focus( button );
@@ -260,12 +260,12 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
wxRadioBox::~wxRadioBox() wxRadioBox::~wxRadioBox()
{ {
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
gtk_widget_destroy( button ); gtk_widget_destroy( button );
node = node->Next(); node = node->GetNext();
} }
} }
@@ -314,10 +314,10 @@ wxSize wxRadioBox::LayoutItems()
y = 15; y = 15;
int max_len = 0; int max_len = 0;
wxNode *node = m_boxes.Nth( j*num_of_rows ); wxNode *node = m_boxes.Item( j*num_of_rows );
for (int i1 = 0; i1< num_of_rows; i1++) for (int i1 = 0; i1< num_of_rows; i1++)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
GtkRequisition req; GtkRequisition req;
req.width = 2; req.width = 2;
@@ -330,20 +330,20 @@ wxSize wxRadioBox::LayoutItems()
gtk_pizza_move( GTK_PIZZA(m_parent->m_wxwindow), button, m_x+x, m_y+y ); gtk_pizza_move( GTK_PIZZA(m_parent->m_wxwindow), button, m_x+x, m_y+y );
y += req.height; y += req.height;
node = node->Next(); node = node->GetNext();
if (!node) break; if (!node) break;
} }
// we don't know the max_len before // we don't know the max_len before
node = m_boxes.Nth( j*num_of_rows ); node = m_boxes.Item( j*num_of_rows );
for (int i2 = 0; i2< num_of_rows; i2++) for (int i2 = 0; i2< num_of_rows; i2++)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
gtk_pizza_resize( GTK_PIZZA(m_parent->m_wxwindow), button, max_len, 20 ); gtk_pizza_resize( GTK_PIZZA(m_parent->m_wxwindow), button, max_len, 20 );
node = node->Next(); node = node->GetNext();
if (!node) break; if (!node) break;
} }
@@ -359,10 +359,10 @@ wxSize wxRadioBox::LayoutItems()
{ {
int max = 0; int max = 0;
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
GtkRequisition req; GtkRequisition req;
req.width = 2; req.width = 2;
@@ -372,18 +372,18 @@ wxSize wxRadioBox::LayoutItems()
if (req.width > max) max = req.width; if (req.width > max) max = req.width;
node = node->Next(); node = node->GetNext();
} }
node = m_boxes.First(); node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
gtk_pizza_set_size( GTK_PIZZA(m_parent->m_wxwindow), button, m_x+x, m_y+y, max, 20 ); gtk_pizza_set_size( GTK_PIZZA(m_parent->m_wxwindow), button, m_x+x, m_y+y, max, 20 );
x += max; x += max;
node = node->Next(); node = node->GetNext();
} }
res.x = x+4; res.x = x+4;
res.y = 40; res.y = 40;
@@ -405,14 +405,14 @@ bool wxRadioBox::Show( bool show )
if ((m_windowStyle & wxNO_BORDER) != 0) if ((m_windowStyle & wxNO_BORDER) != 0)
gtk_widget_hide( m_widget ); gtk_widget_hide( m_widget );
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
if (show) gtk_widget_show( button ); else gtk_widget_hide( button ); if (show) gtk_widget_show( button ); else gtk_widget_hide( button );
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
@@ -424,10 +424,10 @@ int wxRadioBox::FindString( const wxString &find ) const
int count = 0; int count = 0;
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) ); GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
#ifdef __WXGTK20__ #ifdef __WXGTK20__
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) ); wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
#else #else
@@ -438,7 +438,7 @@ int wxRadioBox::FindString( const wxString &find ) const
count++; count++;
node = node->Next(); node = node->GetNext();
} }
return -1; return -1;
@@ -450,16 +450,16 @@ void wxRadioBox::SetFocus()
if (m_boxes.GetCount() == 0) return; if (m_boxes.GetCount() == 0) return;
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
if (button->active) if (button->active)
{ {
gtk_widget_grab_focus( GTK_WIDGET(button) ); gtk_widget_grab_focus( GTK_WIDGET(button) );
return; return;
} }
node = node->Next(); node = node->GetNext();
} }
} }
@@ -467,11 +467,11 @@ void wxRadioBox::SetSelection( int n )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
wxNode *node = m_boxes.Nth( n ); wxNode *node = m_boxes.Item( n );
wxCHECK_RET( node, wxT("radiobox wrong index") ); wxCHECK_RET( node, wxT("radiobox wrong index") );
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
GtkDisableEvents(); GtkDisableEvents();
@@ -486,13 +486,13 @@ int wxRadioBox::GetSelection(void) const
int count = 0; int count = 0;
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
if (button->active) return count; if (button->active) return count;
count++; count++;
node = node->Next(); node = node->GetNext();
} }
wxFAIL_MSG( wxT("wxRadioBox none selected") ); wxFAIL_MSG( wxT("wxRadioBox none selected") );
@@ -504,11 +504,11 @@ wxString wxRadioBox::GetString( int n ) const
{ {
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") ); wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") );
wxNode *node = m_boxes.Nth( n ); wxNode *node = m_boxes.Item( n );
wxCHECK_MSG( node, wxT(""), wxT("radiobox wrong index") ); wxCHECK_MSG( node, wxT(""), wxT("radiobox wrong index") );
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) ); GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
#ifdef __WXGTK20__ #ifdef __WXGTK20__
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) ); wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
@@ -532,11 +532,11 @@ void wxRadioBox::SetString( int item, const wxString& label )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
wxNode *node = m_boxes.Nth( item ); wxNode *node = m_boxes.Item( item );
wxCHECK_RET( node, wxT("radiobox wrong index") ); wxCHECK_RET( node, wxT("radiobox wrong index") );
GtkLabel *g_label = GTK_LABEL( BUTTON_CHILD(node->Data()) ); GtkLabel *g_label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
gtk_label_set( g_label, wxGTK_CONV( label ) ); gtk_label_set( g_label, wxGTK_CONV( label ) );
} }
@@ -546,15 +546,15 @@ bool wxRadioBox::Enable( bool enable )
if ( !wxControl::Enable( enable ) ) if ( !wxControl::Enable( enable ) )
return FALSE; return FALSE;
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkButton *button = GTK_BUTTON( node->Data() ); GtkButton *button = GTK_BUTTON( node->GetData() );
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) ); GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
gtk_widget_set_sensitive( GTK_WIDGET(button), enable ); gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
gtk_widget_set_sensitive( GTK_WIDGET(label), enable ); gtk_widget_set_sensitive( GTK_WIDGET(label), enable );
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
@@ -564,11 +564,11 @@ void wxRadioBox::Enable( int item, bool enable )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
wxNode *node = m_boxes.Nth( item ); wxNode *node = m_boxes.Item( item );
wxCHECK_RET( node, wxT("radiobox wrong index") ); wxCHECK_RET( node, wxT("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() ); GtkButton *button = GTK_BUTTON( node->GetData() );
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) ); GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
gtk_widget_set_sensitive( GTK_WIDGET(button), enable ); gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
@@ -579,11 +579,11 @@ void wxRadioBox::Show( int item, bool show )
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
wxNode *node = m_boxes.Nth( item ); wxNode *node = m_boxes.Item( item );
wxCHECK_RET( node, wxT("radiobox wrong index") ); wxCHECK_RET( node, wxT("radiobox wrong index") );
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
if (show) if (show)
gtk_widget_show( button ); gtk_widget_show( button );
@@ -595,13 +595,13 @@ wxString wxRadioBox::GetStringSelection() const
{ {
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") ); wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") );
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
if (button->active) if (button->active)
{ {
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) ); GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
#ifdef __WXGTK20__ #ifdef __WXGTK20__
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) ); wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
@@ -610,7 +610,7 @@ wxString wxRadioBox::GetStringSelection() const
#endif #endif
return str; return str;
} }
node = node->Next(); node = node->GetNext();
} }
wxFAIL_MSG( wxT("wxRadioBox none selected") ); wxFAIL_MSG( wxT("wxRadioBox none selected") );
@@ -630,7 +630,7 @@ bool wxRadioBox::SetStringSelection( const wxString &s )
int wxRadioBox::GetCount() const int wxRadioBox::GetCount() const
{ {
return m_boxes.Number(); return m_boxes.GetCount();
} }
int wxRadioBox::GetNumberOfRowsOrCols() const int wxRadioBox::GetNumberOfRowsOrCols() const
@@ -645,25 +645,25 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
void wxRadioBox::GtkDisableEvents() void wxRadioBox::GtkDisableEvents()
{ {
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
gtk_signal_disconnect_by_func( GTK_OBJECT(node->Data()), gtk_signal_disconnect_by_func( GTK_OBJECT(node->GetData()),
GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
node = node->Next(); node = node->GetNext();
} }
} }
void wxRadioBox::GtkEnableEvents() void wxRadioBox::GtkEnableEvents()
{ {
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
gtk_signal_connect( GTK_OBJECT(node->Data()), "clicked", gtk_signal_connect( GTK_OBJECT(node->GetData()), "clicked",
GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
node = node->Next(); node = node->GetNext();
} }
} }
@@ -673,27 +673,27 @@ void wxRadioBox::ApplyWidgetStyle()
gtk_widget_set_style( m_widget, m_widgetStyle ); gtk_widget_set_style( m_widget, m_widgetStyle );
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *widget = GTK_WIDGET( node->Data() ); GtkWidget *widget = GTK_WIDGET( node->GetData() );
gtk_widget_set_style( widget, m_widgetStyle ); gtk_widget_set_style( widget, m_widgetStyle );
gtk_widget_set_style( BUTTON_CHILD(node->Data()), m_widgetStyle ); gtk_widget_set_style( BUTTON_CHILD(node->GetData()), m_widgetStyle );
node = node->Next(); node = node->GetNext();
} }
} }
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS
void wxRadioBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip ) void wxRadioBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
{ {
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *widget = GTK_WIDGET( node->Data() ); GtkWidget *widget = GTK_WIDGET( node->GetData() );
gtk_tooltips_set_tip( tips, widget, wxConvCurrent->cWX2MB(tip), (gchar*) NULL ); gtk_tooltips_set_tip( tips, widget, wxConvCurrent->cWX2MB(tip), (gchar*) NULL );
node = node->Next(); node = node->GetNext();
} }
} }
#endif // wxUSE_TOOLTIPS #endif // wxUSE_TOOLTIPS
@@ -702,14 +702,14 @@ bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window )
{ {
if (window == m_widget->window) return TRUE; if (window == m_widget->window) return TRUE;
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.GetFirst();
while (node) while (node)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->GetData() );
if (window == button->window) return TRUE; if (window == button->window) return TRUE;
node = node->Next(); node = node->GetNext();
} }
return FALSE; return FALSE;

View File

@@ -1511,12 +1511,12 @@ wxWindowGTK *FindWindowForMouseEvent(wxWindowGTK *win, wxCoord& x, wxCoord& y)
yy += pizza->yoffset; yy += pizza->yoffset;
} }
wxNode *node = win->GetChildren().First(); wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindowGTK *child = (wxWindowGTK*)node->Data(); wxWindowGTK *child = node->GetData();
node = node->Next(); node = node->GetNext();
if (!child->IsShown()) if (!child->IsShown())
continue; continue;