- support wxListCtrl columns alignment for all platforms and not just MSW
- added wxDateSpan::operator==() and !=() (Lukasz Michalski)
- 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:
wxList& GetCommands() const { return (wxList&) m_commands; }
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; }
virtual void ClearCommands();
void SetKeyInteger(long i) { m_key.integer = i; }
#ifdef wxLIST_COMPATIBILITY
- // compatibility methods
- wxNode *Next() const { return (wxNode *)GetNext(); }
- wxNode *Previous() const { return (wxNode *)GetPrevious(); }
- wxObject *Data() const { return (wxObject *)GetData(); }
+ // compatibility methods, use Get* instead.
+ wxDEPRECATED( wxNode *Next() const );
+ wxDEPRECATED( wxNode *Previous() const );
+ wxDEPRECATED( wxObject *Data() const );
#endif // wxLIST_COMPATIBILITY
protected:
// a double-linked list class
// -----------------------------------------------------------------------------
+class wxList;
+
class WXDLLEXPORT wxListBase : public wxObject
{
friend class WXDLLEXPORT wxNodeBase; // should be able to call DetachNode()
{ wxASSERT( m_count==0 ); m_keyType = keyType; }
#ifdef wxLIST_COMPATIBILITY
- int Number() const { return GetCount(); }
- wxNode *First() const { return (wxNode *)GetFirst(); }
- wxNode *Last() const { return (wxNode *)GetLast(); }
- wxNode *Nth(size_t n) const { return (wxNode *)Item(n); }
+ // compatibility methods from old wxList
+ wxDEPRECATED( int Number() const ); // use GetCount instead.
+ wxDEPRECATED( wxNode *First() const ); // use GetFirst
+ 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
protected:
#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
// -----------------------------------------------------------------------------
class WXDLLEXPORT wxList : public wxObjectList
{
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
~wxList() { }
public:
// ctors and such
// default
- wxStringList() { DeleteContents(TRUE); }
+#ifdef wxWARN_COMPAT_LIST_USE
+ wxDEPRECATED( wxStringList() );
+ wxDEPRECATED( wxStringList(const wxChar *first ...) );
+#else
+ wxStringList();
wxStringList(const wxChar *first ...);
+#endif
// copying the string list: the strings are copied, too (extremely
// inefficient!)
void MyCanvas::OnChar( wxKeyEvent &event )
{
- switch ( event.KeyCode() )
+ switch ( event.GetKeyCode() )
{
case WXK_LEFT:
PrevChar();
break;
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;
wxCaretSuspend cs(this);
{
wxLogMessage(_T("MyComboBox::OnChar"));
- if ( event.KeyCode() == 'w' )
+ if ( event.GetKeyCode() == 'w' )
wxLogMessage(_T("MyComboBox: 'w' will be ignored."));
else
event.Skip();
{
wxLogMessage(_T("MyComboBox::OnKeyDown"));
- if ( event.KeyCode() == 'w' )
+ if ( event.GetKeyCode() == 'w' )
wxLogMessage(_T("MyComboBox: 'w' will be ignored."));
else
event.Skip();
{
wxDocument::SaveObject(stream);
- wxInt32 n = doodleSegments.Number();
+ wxInt32 n = doodleSegments.GetCount();
stream << n << '\n';
- wxNode *node = doodleSegments.First();
+ wxNode *node = doodleSegments.GetFirst();
while (node)
{
- DoodleSegment *segment = (DoodleSegment *)node->Data();
+ DoodleSegment *segment = (DoodleSegment *)node->GetData();
segment->SaveObject(stream);
stream << '\n';
- node = node->Next();
+ node = node->GetNext();
}
return stream;
wxTextOutputStream text_stream( stream );
- wxInt32 n = doodleSegments.Number();
+ wxInt32 n = doodleSegments.GetCount();
text_stream << n << '\n';
- wxNode *node = doodleSegments.First();
+ wxNode *node = doodleSegments.GetFirst();
while (node)
{
- DoodleSegment *segment = (DoodleSegment *)node->Data();
+ DoodleSegment *segment = (DoodleSegment *)node->GetData();
segment->SaveObject(stream);
text_stream << '\n';
- node = node->Next();
+ node = node->GetNext();
}
return stream;
DoodleSegment::DoodleSegment(DoodleSegment& seg)
{
- wxNode *node = seg.lines.First();
+ wxNode *node = seg.lines.GetFirst();
while (node)
{
- DoodleLine *line = (DoodleLine *)node->Data();
+ DoodleLine *line = (DoodleLine *)node->GetData();
DoodleLine *newLine = new DoodleLine;
newLine->x1 = line->x1;
newLine->y1 = line->y1;
lines.Append(newLine);
- node = node->Next();
+ node = node->GetNext();
}
}
#if wxUSE_STD_IOSTREAM
wxSTD ostream& DoodleSegment::SaveObject(wxSTD ostream& stream)
{
- wxInt32 n = lines.Number();
+ wxInt32 n = lines.GetCount();
stream << n << '\n';
- wxNode *node = lines.First();
+ wxNode *node = lines.GetFirst();
while (node)
{
- DoodleLine *line = (DoodleLine *)node->Data();
+ DoodleLine *line = (DoodleLine *)node->GetData();
stream << line->x1 << " " <<
line->y1 << " " <<
line->x2 << " " <<
line->y2 << "\n";
- node = node->Next();
+ node = node->GetNext();
}
return stream;
{
wxTextOutputStream text_stream( stream );
- wxInt32 n = lines.Number();
+ wxInt32 n = lines.GetCount();
text_stream << n << _T('\n');
- wxNode *node = lines.First();
+ wxNode *node = lines.GetFirst();
while (node)
{
- DoodleLine *line = (DoodleLine *)node->Data();
+ DoodleLine *line = (DoodleLine *)node->GetData();
text_stream << line->x1 << _T(" ") <<
line->y1 << _T(" ") <<
line->x2 << _T(" ") <<
line->y2 << _T("\n");
- node = node->Next();
+ node = node->GetNext();
}
return stream;
void DoodleSegment::Draw(wxDC *dc)
{
- wxNode *node = lines.First();
+ wxNode *node = lines.GetFirst();
while (node)
{
- DoodleLine *line = (DoodleLine *)node->Data();
+ DoodleLine *line = (DoodleLine *)node->GetData();
dc->DrawLine(line->x1, line->y1, line->x2, line->y2);
- node = node->Next();
+ node = node->GetNext();
}
}
case DOODLE_CUT:
{
// 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)
delete segment;
- segment = (DoodleSegment *)node->Data();
+ segment = (DoodleSegment *)node->GetData();
delete node;
doc->Modify(TRUE);
case DOODLE_ADD:
{
// Cut the last segment
- if (doc->GetDoodleSegments().Number() > 0)
+ if (doc->GetDoodleSegments().GetCount() > 0)
{
- wxNode *node = doc->GetDoodleSegments().Last();
- DoodleSegment *seg = (DoodleSegment *)node->Data();
+ wxNode *node = doc->GetDoodleSegments().GetLast();
+ DoodleSegment *seg = (DoodleSegment *)node->GetData();
delete seg;
delete node;
dc->SetFont(*wxNORMAL_FONT);
dc->SetPen(*wxBLACK_PEN);
- wxNode *node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().First();
+ wxNode *node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().GetFirst();
while (node)
{
- DoodleSegment *seg = (DoodleSegment *)node->Data();
+ DoodleSegment *seg = (DoodleSegment *)node->GetData();
seg->Draw(dc);
- node = node->Next();
+ node = node->GetNext();
}
}
if (currentSegment && event.LeftUp())
{
- if (currentSegment->lines.Number() == 0)
+ if (currentSegment->lines.GetCount() == 0)
{
delete currentSegment;
currentSegment = (DoodleSegment *) NULL;
{
wxDocument::SaveObject(stream);
- wxInt32 n = doodleSegments.Number();
+ wxInt32 n = doodleSegments.GetCount();
stream << n << _T('\n');
- wxNode *node = doodleSegments.First();
+ wxNode *node = doodleSegments.GetFirst();
while (node)
{
- DoodleSegment *segment = (DoodleSegment *)node->Data();
+ DoodleSegment *segment = (DoodleSegment *)node->GetData();
segment->SaveObject(stream);
stream << _T('\n');
- node = node->Next();
+ node = node->GetNext();
}
return stream;
wxTextOutputStream text_stream( stream );
- wxInt32 n = doodleSegments.Number();
+ wxInt32 n = doodleSegments.GetCount();
text_stream << n << _T('\n');
- wxNode *node = doodleSegments.First();
+ wxNode *node = doodleSegments.GetFirst();
while (node)
{
- DoodleSegment *segment = (DoodleSegment *)node->Data();
+ DoodleSegment *segment = (DoodleSegment *)node->GetData();
segment->SaveObject(stream);
text_stream << _T('\n');
- node = node->Next();
+ node = node->GetNext();
}
return stream;
DoodleSegment::DoodleSegment(DoodleSegment& seg)
{
- wxNode *node = seg.lines.First();
+ wxNode *node = seg.lines.GetFirst();
while (node)
{
- DoodleLine *line = (DoodleLine *)node->Data();
+ DoodleLine *line = (DoodleLine *)node->GetData();
DoodleLine *newLine = new DoodleLine;
newLine->x1 = line->x1;
newLine->y1 = line->y1;
lines.Append(newLine);
- node = node->Next();
+ node = node->GetNext();
}
}
#if wxUSE_STD_IOSTREAM
wxSTD ostream& DoodleSegment::SaveObject(wxSTD ostream& stream)
{
- wxInt32 n = lines.Number();
+ wxInt32 n = lines.GetCount();
stream << n << _T('\n');
- wxNode *node = lines.First();
+ wxNode *node = lines.GetFirst();
while (node)
{
- DoodleLine *line = (DoodleLine *)node->Data();
+ DoodleLine *line = (DoodleLine *)node->GetData();
stream << line->x1 << _T(" ") <<
line->y1 << _T(" ") <<
line->x2 << _T(" ") <<
line->y2 << _T("\n");
- node = node->Next();
+ node = node->GetNext();
}
return stream;
{
wxTextOutputStream text_stream( stream );
- wxInt32 n = lines.Number();
+ wxInt32 n = lines.GetCount();
text_stream << n << _T('\n');
- wxNode *node = lines.First();
+ wxNode *node = lines.GetFirst();
while (node)
{
- DoodleLine *line = (DoodleLine *)node->Data();
+ DoodleLine *line = (DoodleLine *)node->GetData();
text_stream << line->x1 << _T(" ") <<
line->y1 << _T(" ") <<
line->x2 << _T(" ") <<
line->y2 << _T("\n");
- node = node->Next();
+ node = node->GetNext();
}
return stream;
#endif
void DoodleSegment::Draw(wxDC *dc)
{
- wxNode *node = lines.First();
+ wxNode *node = lines.GetFirst();
while (node)
{
- DoodleLine *line = (DoodleLine *)node->Data();
+ DoodleLine *line = (DoodleLine *)node->GetData();
dc->DrawLine(line->x1, line->y1, line->x2, line->y2);
- node = node->Next();
+ node = node->GetNext();
}
}
case DOODLE_CUT:
{
// 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)
delete segment;
- segment = (DoodleSegment *)node->Data();
+ segment = (DoodleSegment *)node->GetData();
delete node;
doc->Modify(TRUE);
case DOODLE_ADD:
{
// Cut the last segment
- if (doc->GetDoodleSegments().Number() > 0)
+ if (doc->GetDoodleSegments().GetCount() > 0)
{
- wxNode *node = doc->GetDoodleSegments().Last();
- DoodleSegment *seg = (DoodleSegment *)node->Data();
+ wxNode *node = doc->GetDoodleSegments().GetLast();
+ DoodleSegment *seg = (DoodleSegment *)node->GetData();
delete seg;
delete node;
dc->SetFont(*wxNORMAL_FONT);
dc->SetPen(*wxBLACK_PEN);
- wxNode *node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().First();
+ wxNode *node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().GetFirst();
while (node)
{
- DoodleSegment *seg = (DoodleSegment *)node->Data();
+ DoodleSegment *seg = (DoodleSegment *)node->GetData();
seg->Draw(dc);
- node = node->Next();
+ node = node->GetNext();
}
}
if (currentSegment && event.LeftUp())
{
- if (currentSegment->lines.Number() == 0)
+ if (currentSegment->lines.GetCount() == 0)
{
delete currentSegment;
currentSegment = (DoodleSegment *) NULL;
void MyCanvas::DrawShapes(wxDC& dc)
{
- wxNode* node = m_displayList.First();
+ wxNode* node = m_displayList.GetFirst();
while (node)
{
- DragShape* shape = (DragShape*) node->Data();
+ DragShape* shape = (DragShape*) node->GetData();
if (shape->IsShown())
shape->Draw(dc);
- node = node->Next();
+ node = node->GetNext();
}
}
void MyCanvas::ClearShapes()
{
- wxNode* node = m_displayList.First();
+ wxNode* node = m_displayList.GetFirst();
while (node)
{
- DragShape* shape = (DragShape*) node->Data();
+ DragShape* shape = (DragShape*) node->GetData();
delete shape;
- node = node->Next();
+ node = node->GetNext();
}
m_displayList.Clear();
}
DragShape* MyCanvas::FindShape(const wxPoint& pt) const
{
- wxNode* node = m_displayList.First();
+ wxNode* node = m_displayList.GetFirst();
while (node)
{
- DragShape* shape = (DragShape*) node->Data();
+ DragShape* shape = (DragShape*) node->GetData();
if (shape->HitTest(pt))
return shape;
- node = node->Next();
+ node = node->GetNext();
}
return (DragShape*) NULL;
}
void TestGLCanvas::OnKeyDown( wxKeyEvent& event )
{
- long evkey = event.KeyCode();
+ long evkey = event.GetKeyCode();
if (evkey == 0) return;
if (!m_TimeInitialized)
void TestGLCanvas::OnChar(wxKeyEvent& event)
{
- switch(event.KeyCode()) {
+ switch(event.GetKeyCode()) {
case WXK_ESCAPE:
exit(0);
case WXK_LEFT:
void MyTextCtrl::LogKeyEvent(const wxChar *name, wxKeyEvent& event) const
{
wxString key;
- long keycode = event.KeyCode();
+ long keycode = event.GetKeyCode();
{
switch ( keycode )
{
void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
{
- switch ( event.KeyCode() )
+ switch ( event.GetKeyCode() )
{
case WXK_F1:
// show current position and text length
void LogKeyEvent(const wxChar *name, const wxKeyEvent& event)
{
wxString key;
- long keycode = event.KeyCode();
+ long keycode = event.GetKeyCode();
{
switch ( keycode )
{
}
// iterate until the list becomes empty
- wxNode *node = wxPendingEvents->First();
+ wxNode *node = wxPendingEvents->GetFirst();
while (node)
{
- wxEvtHandler *handler = (wxEvtHandler *)node->Data();
+ wxEvtHandler *handler = (wxEvtHandler *)node->GetData();
delete node;
// In ProcessPendingEvents(), new handlers might be add
handler->ProcessPendingEvents();
wxENTER_CRIT_SECT( *wxPendingEventsLocker );
- node = wxPendingEvents->First();
+ node = wxPendingEvents->GetFirst();
}
wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
{
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();
- wxCommand *firstCommand = (wxCommand *)firstNode->Data();
+ wxNode *firstNode = m_commands.GetFirst();
+ wxCommand *firstCommand = (wxCommand *)firstNode->GetData();
delete firstCommand;
delete firstNode;
}
ClearCommands();
else
{
- wxNode *node = m_currentCommand->Next();
+ wxNode *node = m_currentCommand->GetNext();
while (node)
{
- wxNode *next = node->Next();
- delete (wxCommand *)node->Data();
+ wxNode *next = node->GetNext();
+ delete (wxCommand *)node->GetData();
delete node;
node = next;
}
}
m_commands.Append(command);
- m_currentCommand = m_commands.Last();
+ m_currentCommand = m_commands.GetLast();
SetMenuStrings();
}
{
if ( UndoCommand(*command) )
{
- m_currentCommand = m_currentCommand->Previous();
+ m_currentCommand = m_currentCommand->GetPrevious();
SetMenuStrings();
return TRUE;
}
if ( m_currentCommand )
{
// is there anything to redo?
- if ( m_currentCommand->Next() )
+ if ( m_currentCommand->GetNext() )
{
- redoCommand = (wxCommand *)m_currentCommand->Next()->Data();
- redoNode = m_currentCommand->Next();
+ redoCommand = (wxCommand *)m_currentCommand->GetNext()->GetData();
+ redoNode = m_currentCommand->GetNext();
}
}
else // no current command, redo the first one
{
- if (m_commands.Number() > 0)
+ if (m_commands.GetCount() > 0)
{
- redoCommand = (wxCommand *)m_commands.First()->Data();
- redoNode = m_commands.First();
+ redoCommand = (wxCommand *)m_commands.GetFirst()->GetData();
+ redoNode = m_commands.GetFirst();
}
}
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;
- if ((m_currentCommand != (wxNode*) NULL) && (m_currentCommand->Next() != (wxNode*) NULL))
+ if ((m_currentCommand != (wxNode*) NULL) && (m_currentCommand->GetNext() != (wxNode*) NULL))
return TRUE;
- if ((m_currentCommand == (wxNode*) NULL) && (m_commands.Number() > 0))
+ if ((m_currentCommand == (wxNode*) NULL) && (m_commands.GetCount() > 0))
return TRUE;
return FALSE;
void wxCommandProcessor::Initialize()
{
- m_currentCommand = m_commands.Last();
+ m_currentCommand = m_commands.GetLast();
SetMenuStrings();
}
wxString buf;
if (m_currentCommand)
{
- wxCommand *command = (wxCommand *)m_currentCommand->Data();
+ wxCommand *command = (wxCommand *)m_currentCommand->GetData();
wxString commandName(command->GetName());
if (commandName == wxT("")) commandName = _("Unnamed command");
bool canUndo = command->CanUndo();
if (m_currentCommand)
{
// 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());
if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;
}
else
{
- if (m_commands.Number() == 0)
+ if (m_commands.GetCount() == 0)
{
buf = _("&Redo") + m_redoAccelerator;
}
{
// currentCommand is NULL but there are commands: this means that
// 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());
if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;
void wxCommandProcessor::ClearCommands()
{
- wxNode *node = m_commands.First();
+ wxNode *node = m_commands.GetFirst();
while (node)
{
- wxCommand *command = (wxCommand *)node->Data();
+ wxCommand *command = (wxCommand *)node->GetData();
delete command;
delete node;
- node = m_commands.First();
+ node = m_commands.GetFirst();
}
m_currentCommand = (wxNode *) NULL;
}
void wxDCBase::DrawLines(const wxList *list, wxCoord xoffset, wxCoord yoffset)
{
- int n = list->Number();
+ int n = list->GetCount();
wxPoint *points = new wxPoint[n];
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].y = point->y;
}
wxCoord xoffset, wxCoord yoffset,
int fillStyle)
{
- int n = list->Number();
+ int n = list->GetCount();
wxPoint *points = new wxPoint[n];
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].y = point->y;
}
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;
}
}
static void wx_spline_draw_point_array(wxDCBase *dc)
{
dc->DrawLines(&wx_spline_point_list, 0, 0 );
- wxNode *node = wx_spline_point_list.First();
+ wxNode *node = wx_spline_point_list.GetFirst();
while (node)
{
- wxPoint *point = (wxPoint *)node->Data();
+ wxPoint *point = (wxPoint *)node->GetData();
delete point;
delete node;
- node = wx_spline_point_list.First();
+ node = wx_spline_point_list.GetFirst();
}
}
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
double x1, y1, x2, y2;
- wxNode *node = points->First();
- p = (wxPoint *)node->Data();
+ wxNode *node = points->GetFirst();
+ p = (wxPoint *)node->GetData();
x1 = p->x;
y1 = p->y;
- node = node->Next();
- p = (wxPoint *)node->Data();
+ node = node->GetNext();
+ p = (wxPoint *)node->GetData();
x2 = p->x;
y2 = p->y;
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;
y1 = y2;
x2 = p->x;
{
wxDocManager* manager = GetDocumentManager();
- wxNode *node = m_documentViews.First();
+ wxNode *node = m_documentViews.GetFirst();
while (node)
{
- wxView *view = (wxView *)node->Data();
+ wxView *view = (wxView *)node->GetData();
if (!view->Close())
return FALSE;
- wxNode *next = node->Next();
+ wxNode *next = node->GetNext();
delete view; // Deletes node implicitly
node = next;
wxView *wxDocument::GetFirstView() const
{
- if (m_documentViews.Number() == 0)
+ if (m_documentViews.GetCount() == 0)
return (wxView *) NULL;
- return (wxView *)m_documentViews.First()->Data();
+ return (wxView *)m_documentViews.GetFirst()->GetData();
}
wxDocManager *wxDocument::GetDocumentManager() const
GetDocumentManager()->AddFileToHistory(fileName);
// Notify the views that the filename has changed
- wxNode *node = m_documentViews.First();
+ wxNode *node = m_documentViews.GetFirst();
while (node)
{
- wxView *view = (wxView *)node->Data();
+ wxView *view = (wxView *)node->GetData();
view->OnChangeFilename();
- node = node->Next();
+ node = node->GetNext();
}
return OnSaveDocument(m_documentFile);
// there are no more views.
void wxDocument::OnChangedViewList()
{
- if (m_documentViews.Number() == 0)
+ if (m_documentViews.GetCount() == 0)
{
if (OnSaveModified())
{
void wxDocument::UpdateAllViews(wxView *sender, wxObject *hint)
{
- wxNode *node = m_documentViews.First();
+ wxNode *node = m_documentViews.GetFirst();
while (node)
{
- wxView *view = (wxView *)node->Data();
+ wxView *view = (wxView *)node->GetData();
if (view != sender)
view->OnUpdate(sender, hint);
- node = node->Next();
+ node = node->GetNext();
}
}
void wxDocument::NotifyClosing()
{
- wxNode *node = m_documentViews.First();
+ wxNode *node = m_documentViews.GetFirst();
while (node)
{
- wxView *view = (wxView *)node->Data();
+ wxView *view = (wxView *)node->GetData();
view->OnClosingDocument();
- node = node->Next();
+ node = node->GetNext();
}
}
if ( notifyViews )
{
// Notify the views that the filename has changed
- wxNode *node = m_documentViews.First();
+ wxNode *node = m_documentViews.GetFirst();
while (node)
{
- wxView *view = (wxView *)node->Data();
+ wxView *view = (wxView *)node->GetData();
view->OnChangeFilename();
- node = node->Next();
+ node = node->GetNext();
}
}
}
bool wxDocManager::CloseDocuments(bool force)
{
- wxNode *node = m_docs.First();
+ wxNode *node = m_docs.GetFirst();
while (node)
{
- wxDocument *doc = (wxDocument *)node->Data();
- wxNode *next = node->Next();
+ wxDocument *doc = (wxDocument *)node->GetData();
+ wxNode *next = node->GetNext();
if (!doc->Close() && !force)
return FALSE;
if (!CloseDocuments(force))
return FALSE;
- wxNode *node = m_templates.First();
+ wxNode *node = m_templates.GetFirst();
while (node)
{
- wxDocTemplate *templ = (wxDocTemplate*) node->Data();
- wxNode* next = node->Next();
+ wxDocTemplate *templ = (wxDocTemplate*) node->GetData();
+ wxNode* next = node->GetNext();
delete templ;
node = next;
}
{
if (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 (wxView *) NULL;
wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
{
- wxDocTemplate **templates = new wxDocTemplate *[m_templates.Number()];
- int i;
- int n = 0;
- for (i = 0; i < m_templates.Number(); i++)
+ wxDocTemplate **templates = new wxDocTemplate *[m_templates.GetCount()];
+ int n = 0;
+
+ 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())
{
templates[n] = temp;
// If we've reached the max number of docs, close the
// 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())
{
// Implicitly deletes the document when
wxView *wxDocManager::CreateView(wxDocument *doc, long flags)
{
- wxDocTemplate **templates = new wxDocTemplate *[m_templates.Number()];
- int n =0;
- int i;
- for (i = 0; i < m_templates.Number(); i++)
+ wxDocTemplate **templates = new wxDocTemplate *[m_templates.GetCount()];
+ int n =0;
+
+ 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->GetDocumentName() == doc->GetDocumentName())
wxDocTemplate *theTemplate = (wxDocTemplate *) NULL;
// Find the template which this extension corresponds to
- 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->FileMatchesTemplate(path) )
{
theTemplate = temp;
// Move existing files (if any) down so we can insert file at beginning.
if (m_fileHistoryN < m_fileMaxFiles)
{
- wxNode* node = m_fileMenus.First();
+ wxNode* node = m_fileMenus.GetFirst();
while (node)
{
- wxMenu* menu = (wxMenu*) node->Data();
+ wxMenu* menu = (wxMenu*) node->GetData();
if (m_fileHistoryN == 0)
menu->AppendSeparator();
menu->Append(wxID_FILE1+m_fileHistoryN, _("[EMPTY]"));
- node = node->Next();
+ node = node->GetNext();
}
m_fileHistoryN ++;
}
wxString buf;
buf.Printf(s_MRUEntryFormat, i + 1, pathInMenu.c_str());
- wxNode* node = m_fileMenus.First();
+ wxNode* node = m_fileMenus.GetFirst();
while (node)
{
- wxMenu* menu = (wxMenu*) node->Data();
+ wxMenu* menu = (wxMenu*) node->GetData();
menu->SetLabel(wxID_FILE1 + i, buf);
- node = node->Next();
+ node = node->GetNext();
}
}
}
m_fileHistory[j] = m_fileHistory[j + 1];
}
- wxNode* node = m_fileMenus.First();
+ wxNode* node = m_fileMenus.GetFirst();
while ( node )
{
- wxMenu* menu = (wxMenu*) node->Data();
+ wxMenu* menu = (wxMenu*) node->GetData();
// shuffle filenames up
menu->SetLabel(wxID_FILE1 + j, buf);
}
- node = node->Next();
+ node = node->GetNext();
// delete the last menu item which is unused now
if (menu->FindItem(wxID_FILE1 + m_fileHistoryN - 1))
{
if (m_fileHistoryN > 0)
{
- wxNode* node = m_fileMenus.First();
+ wxNode* node = m_fileMenus.GetFirst();
while (node)
{
- wxMenu* menu = (wxMenu*) node->Data();
+ wxMenu* menu = (wxMenu*) node->GetData();
menu->AppendSeparator();
int i;
for (i = 0; i < m_fileHistoryN; i++)
menu->Append(wxID_FILE1+i, buf);
}
}
- node = node->Next();
+ node = node->GetNext();
}
}
}
if (m_dynamicEvents)
{
- wxNode *node = m_dynamicEvents->First();
+ wxNode *node = m_dynamicEvents->GetFirst();
while (node)
{
#if WXWIN_COMPATIBILITY_EVENT_TYPES
- wxEventTableEntry *entry = (wxEventTableEntry*)node->Data();
+ wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData();
#else // !WXWIN_COMPATIBILITY_EVENT_TYPES
- wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->Data();
+ wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
if (entry->m_callbackUserData)
delete entry->m_callbackUserData;
delete entry;
- node = node->Next();
+ node = node->GetNext();
}
delete m_dynamicEvents;
};
wxENTER_CRIT_SECT( *m_eventsLocker);
#endif
- wxNode *node = m_pendingEvents->First();
+ wxNode *node = m_pendingEvents->GetFirst();
while ( node )
{
- wxEvent *event = (wxEvent *)node->Data();
+ wxEvent *event = (wxEvent *)node->GetData();
delete node;
// In ProcessEvent, new events might get added and
wxENTER_CRIT_SECT( *m_eventsLocker);
#endif
- node = m_pendingEvents->First();
+ node = m_pendingEvents->GetFirst();
}
#if defined(__VISAGECPP__)
if (!m_dynamicEvents)
return FALSE;
- wxNode *node = m_dynamicEvents->First();
+ wxNode *node = m_dynamicEvents->GetFirst();
while (node)
{
#if WXWIN_COMPATIBILITY_EVENT_TYPES
- wxEventTableEntry *entry = (wxEventTableEntry*)node->Data();
+ wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData();
#else // !WXWIN_COMPATIBILITY_EVENT_TYPES
- wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->Data();
+ wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
if ((entry->m_id == id) &&
delete entry;
return TRUE;
}
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
}
int commandId = event.GetId();
- wxNode *node = m_dynamicEvents->First();
+ wxNode *node = m_dynamicEvents->GetFirst();
while (node)
{
#if WXWIN_COMPATIBILITY_EVENT_TYPES
- wxEventTableEntry *entry = (wxEventTableEntry*)node->Data();
+ wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData();
#else // !WXWIN_COMPATIBILITY_EVENT_TYPES
- wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->Data();
+ wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
if (entry->m_fn)
return TRUE;
}
}
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
};
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 defined(__WINDOWS__) || defined(__VMS__) || defined (__WXMAC__)
// Case INDEPENDENT
path.CompareTo (path2) == 0
#endif
)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
wxString wxPathList::FindValidPath (const wxString& file)
wxChar *filename = (wxChar*) NULL; /* shut up buggy egcs warning */
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);
wxChar ch = wxFileFunctionsBuffer[wxStrlen(wxFileFunctionsBuffer)-1];
if (ch != wxT('\\') && ch != wxT('/'))
}
} // for()
- return wxString(wxT("")); // Not found
+ return wxEmptyString; // Not found
}
wxString wxPathList::FindAbsoluteValidPath (const wxString& file)
// "MacOS:MyText.txt" is absolute whereas "MyDir:MyText.txt"
// is not. Or maybe ":MyDir:MyText.txt" has to be used? RR.
if (filename.Find(':') != wxNOT_FOUND && filename[0] != ':')
- return TRUE ;
+ return true ;
#else
// Unix like or Windows
if (filename[0] == wxT('/'))
- return TRUE;
+ return true;
#endif
#ifdef __VMS__
if ((filename[0] == wxT('[') && filename[1] != wxT('.')))
- return TRUE;
+ return true;
#endif
#ifdef __WINDOWS__
// MSDOS like
if (filename[0] == wxT('\\') || (wxIsalpha (filename[0]) && filename[1] == wxT(':')))
- return TRUE;
+ return true;
#endif
}
- return FALSE ;
+ return false ;
}
/*
s = nm;
d = lnm;
#ifdef __WXMSW__
- q = FALSE;
+ q = false;
#else
q = nm[0] == wxT('\\') && nm[1] == wxT('~');
#endif
int j;
OSErr theErr;
OSStatus theStatus;
- Boolean isDirectory = false;
- Str255 theParentPath = "\p";
+ Boolean isDirectory = false;
+ Str255 theParentPath = "\p";
FSSpec theParentSpec;
FSRef theParentRef;
char theFileName[FILENAME_MAX];
#endif
void wxMacFilename2FSSpec( const char *path , FSSpec *spec )
{
- OSStatus err = noErr ;
+ OSStatus err = noErr ;
#ifdef __DARWIN__
FSRef theRef;
// convert the FSRef to an FSSpec
err = FSGetCatalogInfo(&theRef, kFSCatInfoNone, NULL, NULL, spec, NULL);
#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 ) ;
sMacFileNameConversion[998] = 0 ;
strcat( sMacFileNameConversion , ":" ) ;
}
else
{
- err = FSpLocationFromFullPath( strlen(path) , path , spec ) ;
+ err = FSpLocationFromFullPath( strlen(path) , path , spec ) ;
}
#endif
}
{
wxString outfile;
if ( !wxGetTempFileName( wxT("cat"), outfile) )
- return FALSE;
+ return false;
FILE *fp1 = (FILE *) NULL;
FILE *fp2 = (FILE *) NULL;
fclose (fp2);
if (fp3)
fclose (fp3);
- return FALSE;
+ return false;
}
int ch;
wxLogSysError(_("Failed to copy the file '%s' to '%s'"),
file1.c_str(), file2.c_str());
- return FALSE;
+ return false;
}
#elif defined(__WXPM__)
if ( ::DosCopy(file2, file2, overwrite ? DCPY_EXISTING : 0) != 0 )
- return FALSE;
+ return false;
#else // !Win32
wxStructStat fbuf;
// from it anyhow
wxLogSysError(_("Impossible to get permissions for file '%s'"),
file1.c_str());
- return FALSE;
+ return false;
}
// open file1 for reading
wxFile fileIn(file1, wxFile::read);
if ( !fileIn.IsOpened() )
- return FALSE;
+ return false;
// remove file2, if it exists. This is needed for creating
// file2 with the correct permissions in the next step
{
wxLogSysError(_("Impossible to overwrite the file '%s'"),
file2.c_str());
- return FALSE;
+ return false;
}
#ifdef __UNIX__
wxFile fileOut;
if ( !fileOut.Create(file2, overwrite, fbuf.st_mode & 0777) )
- return FALSE;
+ return false;
#ifdef __UNIX__
/// restore the old umask
{
count = fileIn.Read(buf, WXSIZEOF(buf));
if ( fileIn.Error() )
- return FALSE;
+ return false;
// end of file?
if ( !count )
break;
if ( fileOut.Write(buf, count) < count )
- return FALSE;
+ return false;
}
// 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
// detected before doing this
if ( !fileIn.Close() || !fileOut.Close() )
- return FALSE;
+ return false;
#if !defined(__VISAGECPP__) && !defined(__WXMAC__) || defined(__UNIX__)
// no chmod in VA. Should be some permission API for HPFS386 partitions
{
wxLogSysError(_("Impossible to set permissions for the file '%s'"),
file2.c_str());
- return FALSE;
+ return false;
}
#endif // OS/2 || Mac
#endif // __WXMSW__ && __WIN32__
- return TRUE;
+ return true;
}
bool
{
// Normal system call
if ( wxRename (file1, file2) == 0 )
- return TRUE;
+ return true;
// Try to copy
if (wxCopyFile(file1, file2)) {
wxRemoveFile(file1);
- return TRUE;
+ return true;
}
// Give up
- return FALSE;
+ return false;
}
bool wxRemoveFile(const wxString& file)
{
wxLogSysError(_("Directory '%s' couldn't be created"), dirname);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
#endif // Mac/!Mac
}
bool wxRmdir(const wxString& dir, int WXUNUSED(flags))
{
#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__)
return (::DosDeleteDir((PSZ)dir.c_str()) == 0);
#else
#ifdef __SALFORDC__
- return FALSE; // What to do?
+ return false; // What to do?
#else
return (wxRmDir(OS_FILENAME(dir)) == 0);
#endif
buf = new wxChar[sz + 1];
}
- bool ok = FALSE;
+ bool ok = false;
// for the compilers which have Unicode version of _getcwd(), call it
// directly, for the others call the ANSI version and do the translation
#if !wxUSE_UNICODE
#define cbuf buf
#else // wxUSE_UNICODE
- bool needsANSI = TRUE;
+ bool needsANSI = true;
#if !defined(HAVE_WGETCWD) || wxUSE_UNICODE_MSLU
// This is not legal code as the compiler
#if wxUSE_UNICODE_MSLU
if ( wxGetOsVersion() != wxWIN95 )
#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
{
ok = _wgetcwd(buf, sz) != NULL;
- needsANSI = FALSE;
+ needsANSI = false;
}
#endif
strcpy( cbuf , res ) ;
cbuf[res.length()]=0 ;
- ok = TRUE;
+ ok = true;
}
else
{
- ok = FALSE;
+ ok = false;
}
#elif defined(__VISAGECPP__) || (defined (__OS2__) && defined (__WATCOMC__))
APIRET rc;
bool wxFindFileInPath(wxString *pStr, const wxChar *pszPath, const wxChar *pszFile)
{
// we assume that it's not empty
- wxCHECK_MSG( !wxIsEmpty(pszFile), FALSE,
+ wxCHECK_MSG( !wxIsEmpty(pszFile), false,
_T("empty file name in wxFindFileInPath"));
// skip path separator in the beginning of the file name if present
switch (*pat++)
{
case wxT('?'): case wxT('*'): case wxT('['): case wxT('{'):
- return TRUE;
+ return true;
case wxT('\\'):
if (!*pat++)
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
/*
{
/* Never match so that hidden Unix files
* are never found. */
- return FALSE;
+ return false;
}
for (;;)
{
m++;
if (!*n++)
- return FALSE;
+ return false;
}
else
{
m++;
/* Quoting "nothing" is a bad thing */
if (!*m)
- return FALSE;
+ return false;
}
if (!*m)
{
* match
*/
if (!*n)
- return TRUE;
+ return true;
if (just)
- return TRUE;
+ return true;
just = 0;
goto not_matched;
}
* impossible to match it
*/
if (!*n)
- return FALSE;
+ return false;
if (mp)
{
m = mp;
count = acount;
}
else
- return FALSE;
+ return false;
}
}
}
wxColourDatabase::~wxColourDatabase ()
{
// Cleanup Colour allocated in Initialize()
- wxNode *node = First ();
+ wxNode *node = GetFirst ();
while (node)
{
- wxColour *col = (wxColour *) node->Data ();
- wxNode *next = node->Next ();
+ wxColour *col = (wxColour *) node->GetData ();
+ wxNode *next = node->GetNext ();
delete col;
node = next;
}
if ( !colName2.Replace(_T("GRAY"), _T("GREY")) )
colName2.clear();
- wxNode *node = First();
+ wxNode *node = GetFirst();
while ( node )
{
const wxChar *key = node->GetKeyString();
if ( colName == key || colName2 == key )
{
- return (wxColour *)node->Data();
+ return (wxColour *)node->GetData();
}
- node = node->Next();
+ node = node->GetNext();
}
#ifdef __WXMSW__
unsigned char green = colour.Green ();
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)
{
wxBitmapList::~wxBitmapList ()
{
- wxNode *node = First ();
+ wxNode *node = GetFirst ();
while (node)
{
- wxBitmap *bitmap = (wxBitmap *) node->Data ();
- wxNode *next = node->Next ();
+ wxBitmap *bitmap = (wxBitmap *) node->GetData ();
+ wxNode *next = node->GetNext ();
if (bitmap->GetVisible())
delete bitmap;
node = next;
// Pen and Brush lists
wxPenList::~wxPenList ()
{
- wxNode *node = First ();
+ wxNode *node = GetFirst ();
while (node)
{
- wxPen *pen = (wxPen *) node->Data ();
- wxNode *next = node->Next ();
+ wxPen *pen = (wxPen *) node->GetData ();
+ wxNode *next = node->GetNext ();
if (pen->GetVisible())
delete pen;
node = next;
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 &&
each_pen->GetVisible() &&
each_pen->GetWidth () == width &&
wxBrushList::~wxBrushList ()
{
- wxNode *node = First ();
+ wxNode *node = GetFirst ();
while (node)
{
- wxBrush *brush = (wxBrush *) node->Data ();
- wxNode *next = node->Next ();
+ wxBrush *brush = (wxBrush *) node->GetData ();
+ wxNode *next = node->GetNext ();
if (brush && brush->GetVisible())
delete brush;
node = next;
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 &&
each_brush->GetVisible() &&
each_brush->GetStyle () == style &&
wxFontList::~wxFontList ()
{
- wxNode *node = First ();
+ wxNode *node = GetFirst ();
while (node)
{
// Only delete objects that are 'visible', i.e.
// that have been created using FindOrCreate...,
// where the pointers are expected to be shared
// (and therefore not deleted by any one part of an app).
- wxFont *font = (wxFont *) node->Data ();
- wxNode *next = node->Next ();
+ wxFont *font = (wxFont *) node->GetData ();
+ wxNode *next = node->GetNext ();
if (font->GetVisible())
delete font;
node = next;
{
wxFont *font = (wxFont *)NULL;
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() &&
font->Ok() &&
font->GetPointSize () == pointSize &&
wxResourceCache::~wxResourceCache ()
{
- wxNode *node = First ();
+ wxNode *node = GetFirst ();
while (node) {
- wxObject *item = (wxObject *)node->Data();
+ wxObject *item = (wxObject *)node->GetData();
delete item;
- node = node->Next ();
+ node = node->GetNext ();
}
}
{
wxNode *node = hash_table[position]->Find (value);
if (node)
- return node->Data ();
+ return node->GetData ();
else
return (wxObject *) NULL;
}
{
wxNode *node = hash_table[position]->Find (value);
if (node)
- return node->Data ();
+ return node->GetData ();
else
return (wxObject *) NULL;
}
else
{
wxNode *node = hash_table[position]->Find (k);
- return node ? node->Data () : (wxObject*)NULL;
+ return node ? node->GetData () : (wxObject*)NULL;
}
}
else
{
wxNode *node = hash_table[position]->Find (key);
- return node ? node->Data () : (wxObject*)NULL;
+ return node ? node->GetData () : (wxObject*)NULL;
}
}
wxNode *node = hash_table[position]->Find (k);
if (node)
{
- wxObject *data = node->Data ();
+ wxObject *data = node->GetData ();
delete node;
m_count--;
return data;
wxNode *node = hash_table[position]->Find (key);
if (node)
{
- wxObject *data = node->Data ();
+ wxObject *data = node->GetData ();
delete node;
m_count--;
return data;
wxNode *node = hash_table[position]->Find (value);
if (node)
{
- wxObject *data = node->Data ();
+ wxObject *data = node->GetData ();
delete node;
m_count--;
return data;
wxNode *node = hash_table[position]->Find (value);
if (node)
{
- wxObject *data = node->Data ();
+ wxObject *data = node->GetData ();
delete node;
m_count--;
return data;
{
if (hash_table[current_position])
{
- current_node = hash_table[current_position]->First ();
+ current_node = hash_table[current_position]->GetFirst ();
found = current_node;
}
}
}
else
{
- current_node = current_node->Next ();
+ current_node = current_node->GetNext ();
found = current_node;
}
}
void wxHTTP::ClearHeaders()
{
// wxString isn't a wxObject
- wxNode *node = m_headers.First();
+ wxNode *node = m_headers.GetFirst();
wxString *string;
while (node) {
- string = (wxString *)node->Data();
+ string = (wxString *)node->GetData();
delete string;
- node = node->Next();
+ node = node->GetNext();
}
m_headers.Clear();
if (!node)
m_headers.Append(header, (wxObject *)(new wxString(h_data)));
else {
- wxString *str = (wxString *)node->Data();
+ wxString *str = (wxString *)node->GetData();
(*str) = h_data;
}
}
if (!node)
return wxEmptyString;
- return *((wxString *)node->Data());
+ return *((wxString *)node->GetData());
}
void wxHTTP::SendHeaders()
{
- wxNode *head = m_headers.First();
+ wxNode *head = m_headers.GetFirst();
while (head)
{
- wxString *str = (wxString *)head->Data();
+ wxString *str = (wxString *)head->GetData();
wxString buf;
buf.Printf(wxT("%s: %s\r\n"), head->GetKeyString(), str->GetData());
const wxWX2MBbuf cbuf = buf.mb_str();
Write(cbuf, strlen(cbuf));
- head = head->Next();
+ head = head->GetNext();
}
}
wxImageHandler *wxImage::FindHandler( const wxString& name )
{
- wxNode *node = sm_handlers.First();
+ wxNode *node = sm_handlers.GetFirst();
while (node)
{
- wxImageHandler *handler = (wxImageHandler*)node->Data();
+ wxImageHandler *handler = (wxImageHandler*)node->GetData();
if (handler->GetName().Cmp(name) == 0) return handler;
- node = node->Next();
+ node = node->GetNext();
}
return 0;
}
wxImageHandler *wxImage::FindHandler( const wxString& extension, long bitmapType )
{
- wxNode *node = sm_handlers.First();
+ wxNode *node = sm_handlers.GetFirst();
while (node)
{
- wxImageHandler *handler = (wxImageHandler*)node->Data();
+ wxImageHandler *handler = (wxImageHandler*)node->GetData();
if ( (handler->GetExtension().Cmp(extension) == 0) &&
(bitmapType == -1 || handler->GetType() == bitmapType) )
return handler;
- node = node->Next();
+ node = node->GetNext();
}
return 0;
}
wxImageHandler *wxImage::FindHandler( long bitmapType )
{
- wxNode *node = sm_handlers.First();
+ wxNode *node = sm_handlers.GetFirst();
while (node)
{
- wxImageHandler *handler = (wxImageHandler *)node->Data();
+ wxImageHandler *handler = (wxImageHandler *)node->GetData();
if (handler->GetType() == bitmapType) return handler;
- node = node->Next();
+ node = node->GetNext();
}
return 0;
}
wxImageHandler *wxImage::FindHandlerMime( const wxString& mimetype )
{
- wxNode *node = sm_handlers.First();
+ wxNode *node = sm_handlers.GetFirst();
while (node)
{
- wxImageHandler *handler = (wxImageHandler *)node->Data();
+ wxImageHandler *handler = (wxImageHandler *)node->GetData();
if (handler->GetMimeType().IsSameAs(mimetype, FALSE)) return handler;
- node = node->Next();
+ node = node->GetNext();
}
return 0;
}
void wxImage::CleanUpHandlers()
{
- wxNode *node = sm_handlers.First();
+ wxNode *node = sm_handlers.GetFirst();
while (node)
{
- wxImageHandler *handler = (wxImageHandler *)node->Data();
- wxNode *next = node->Next();
+ wxImageHandler *handler = (wxImageHandler *)node->GetData();
+ wxNode *next = node->GetNext();
delete handler;
delete node;
node = next;
// go through the list and put the pointers into the array
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
// put the sorted pointers back into the list
objPtr = objArray;
- for ( node = GetFirst(); node; node = node->Next() )
+ for ( node = GetFirst(); node; node = node->GetNext() )
{
node->SetData(*objPtr++);
}
#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)
// -----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxList, wxObject)
+wxList::wxList( int key_type )
+ : wxObjectList( (wxKeyType)key_type )
+{
+}
+
void wxObjectListNode::DeleteData()
{
delete (wxObject *)GetData();
}
}
+wxStringList::wxStringList()
+{
+ DeleteContents(TRUE);
+}
+
// Variable argument list, terminated by a zero
// Makes new storage for the strings
wxStringList::wxStringList (const wxChar *first, ...)
node = wxClassInfo::sm_classTable->Next();
while (node)
{
- classInfo = (wxClassInfo *)node->Data();
+ classInfo = (wxClassInfo *)node->GetData();
if ( classInfo->IsKindOf(CLASSINFO(wxModule)) &&
(classInfo != (& (wxModule::sm_classwxModule))) )
{
{
wxNode *node = Find(name);
if (node)
- return (wxPrintPaperType *)node->Data();
+ return (wxPrintPaperType *)node->GetData();
else
return (wxPrintPaperType *) NULL;
}
wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(wxPaperSize id)
{
- wxNode *node = First();
+ wxNode *node = GetFirst();
while (node)
{
- wxPrintPaperType* paperType = (wxPrintPaperType*) node->Data();
+ wxPrintPaperType* paperType = (wxPrintPaperType*) node->GetData();
if (paperType->GetId() == id)
return paperType;
- node = node->Next();
+ node = node->GetNext();
}
return (wxPrintPaperType *) NULL;
}
wxPrintPaperType *wxPrintPaperDatabase::FindPaperTypeByPlatformId(int id)
{
- wxNode *node = First();
+ wxNode *node = GetFirst();
while (node)
{
- wxPrintPaperType* paperType = (wxPrintPaperType*) node->Data();
+ wxPrintPaperType* paperType = (wxPrintPaperType*) node->GetData();
if (paperType->GetPlatformId() == id)
return paperType;
- node = node->Next();
+ node = node->GetNext();
}
return (wxPrintPaperType *) NULL;
}
wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const wxSize& sz)
{
- wxNode *node = First();
+ wxNode *node = GetFirst();
while (node)
{
- wxPrintPaperType* paperType = (wxPrintPaperType*) node->Data();
+ wxPrintPaperType* paperType = (wxPrintPaperType*) node->GetData();
if (paperType->GetSize() == sz)
return paperType;
- node = node->Next();
+ node = node->GetNext();
}
return (wxPrintPaperType *) NULL;
}
wxNode *node;
wxSocketState *state;
- node = m_states.Last();
+ node = m_states.GetLast();
if (!node)
return;
- state = (wxSocketState *)node->Data();
+ state = (wxSocketState *)node->GetData();
m_flags = state->m_flags;
m_notify = state->m_notify;
if (frame->GetToolBar())
extraChildren.Append(frame->GetToolBar());
- wxNode* node = extraChildren.First();
+ wxNode* node = extraChildren.GetFirst();
while (node)
{
- wxWindow* child = (wxWindow*) node->Data();
+ wxWindow* child = (wxWindow*) node->GetData();
wxWindow* foundWin = wxFindWindowAtPoint(child, pt);
if (foundWin)
return foundWin;
}
*/
- wxNode* node = win->GetChildren().Last();
+ wxWindowList::Node *node = win->GetChildren().GetLast();
while (node)
{
- wxWindow* child = (wxWindow*) node->Data();
+ wxWindow* child = node->GetData();
wxWindow* foundWin = wxFindWindowAtPoint(child, pt);
if (foundWin)
return foundWin;
- node = node->Previous();
+ node = node->GetPrevious();
}
wxPoint pos = win->GetPosition();
// Go backwards through the list since windows
// on top are likely to have been appended most
// recently.
- wxNode* node = wxTopLevelWindows.Last();
+ wxWindowList::Node *node = wxTopLevelWindows.GetLast();
while (node)
{
- wxWindow* win = (wxWindow*) node->Data();
+ wxWindow* win = node->GetData();
wxWindow* found = wxFindWindowAtPoint(win, pt);
if (found)
return found;
- node = node->Previous();
+ node = node->GetPrevious();
}
return NULL;
}
m_validatorStyle = val.m_validatorStyle ;
m_stringValue = val.m_stringValue ;
- wxNode *node = val.m_includeList.First() ;
+ wxStringList::Node *node = val.m_includeList.GetFirst() ;
while ( node )
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
m_includeList.Add(s);
- node = node->Next();
+ node = node->GetNext();
}
- node = val.m_excludeList.First() ;
+ node = val.m_excludeList.GetFirst() ;
while ( node )
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
m_excludeList.Add(s);
- node = node->Next();
+ node = node->GetNext();
}
- return TRUE;
+ return true;
}
wxTextValidator::~wxTextValidator()
for ( i = 0; i < (int)val.Length(); i++)
{
if (!wxIsalpha(val[i]))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
static bool wxIsAlphaNumeric(const wxString& val)
for ( i = 0; i < (int)val.Length(); i++)
{
if (!wxIsalnum(val[i]))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
// Called when the value in the window must be validated.
bool wxTextValidator::Validate(wxWindow *parent)
{
if( !CheckValidator() )
- return FALSE;
+ return false;
wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ;
// If window is disabled, simply return
if ( !control->IsEnabled() )
- return TRUE;
+ return true;
wxString val(control->GetValue());
- bool ok = TRUE;
+ bool ok = true;
// NB: this format string should contian exactly one '%s'
wxString errormsg;
}
else if ( (m_validatorStyle & wxFILTER_ASCII) && !val.IsAscii() )
{
- ok = FALSE;
+ ok = false;
errormsg = _("'%s' should only contain ASCII characters.");
}
else if ( (m_validatorStyle & wxFILTER_ALPHA) && !wxIsAlpha(val) )
{
- ok = FALSE;
+ ok = false;
errormsg = _("'%s' should only contain alphabetic characters.");
}
else if ( (m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsAlphaNumeric(val))
{
- ok = FALSE;
+ ok = false;
errormsg = _("'%s' should only contain alphabetic or numeric characters.");
}
else if ( (m_validatorStyle & wxFILTER_NUMERIC) && !wxIsNumeric(val))
{
- ok = FALSE;
+ ok = false;
errormsg = _("'%s' should be numeric.");
}
{
//it's only ok to have the members of the list
errormsg = _("'%s' is invalid");
- ok = FALSE;
+ ok = false;
}
else if ( (m_validatorStyle & wxFILTER_EXCLUDE_CHAR_LIST) && !IsNotInCharExcludeList(val))
{
// it's only ok to have non-members of the list
errormsg = _("'%s' is invalid");
- ok = FALSE;
+ ok = false;
}
if ( !ok )
bool wxTextValidator::TransferToWindow(void)
{
if( !CheckValidator() )
- return FALSE;
+ return false;
wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ;
control->SetValue(* m_stringValue) ;
- return TRUE;
+ return true;
}
// Called to transfer data to the window
bool wxTextValidator::TransferFromWindow(void)
{
if( !CheckValidator() )
- return FALSE;
+ return false;
wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ;
* m_stringValue = control->GetValue() ;
- return TRUE;
+ return true;
}
void wxTextValidator::SetIncludeList(const wxStringList& list)
m_includeList.Clear();
// TODO: replace with =
- wxNode *node = list.First() ;
+ wxStringList::Node *node = list.GetFirst();
while ( node )
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
m_includeList.Add(s);
- node = node->Next();
+ node = node->GetNext();
}
}
m_excludeList.Clear();
// TODO: replace with =
- wxNode *node = list.First() ;
+ wxStringList::Node *node = list.GetFirst() ;
while ( node )
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
m_excludeList.Add(s);
- node = node->Next();
+ node = node->GetNext();
}
}
if (
!(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_ASCII) && !isascii(keyCode)) ||
((m_validatorStyle & wxFILTER_ALPHA) && !wxIsalpha(keyCode)) ||
// use wxSystemSettings or other to do better localisation
if ((!isdigit(val[i])) && (val[i] != '.') && (val[i] != ','))
if(!((i == 0) && (val[i] == '-')))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
bool wxTextValidator::IsInCharIncludeList(const wxString& val)
for ( i = 0; i < val.Length(); i++)
{
if (!m_includeList.Member((wxString) val[i]))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
bool wxTextValidator::IsNotInCharExcludeList(const wxString& val)
for ( i = 0; i < val.Length(); i++)
{
if (m_excludeList.Member((wxString) val[i]))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
#endif
void wxVariantDataList::SetValue(const wxList& value)
{
Clear();
- wxNode* node = value.First();
+ wxNode* node = value.GetFirst();
while (node)
{
- wxVariant* var = (wxVariant*) node->Data();
+ wxVariant* var = (wxVariant*) node->GetData();
m_value.Append(new wxVariant(*var));
- node = node->Next();
+ node = node->GetNext();
}
}
void wxVariantDataList::Clear()
{
- wxNode* node = m_value.First();
+ wxNode* node = m_value.GetFirst();
while (node)
{
- wxVariant* var = (wxVariant*) node->Data();
+ wxVariant* var = (wxVariant*) node->GetData();
delete var;
- node = node->Next();
+ node = node->GetNext();
}
m_value.Clear();
}
wxVariantDataList& listData = (wxVariantDataList&) data;
listData.Clear();
- wxNode* node = m_value.First();
+ wxNode* node = m_value.GetFirst();
while (node)
{
- wxVariant* var = (wxVariant*) node->Data();
+ wxVariant* var = (wxVariant*) node->GetData();
listData.m_value.Append(new wxVariant(*var));
- node = node->Next();
+ node = node->GetNext();
}
}
wxASSERT_MSG( (data.GetType() == wxT("list")), wxT("wxVariantDataList::Eq: argument mismatch") );
wxVariantDataList& listData = (wxVariantDataList&) data;
- wxNode* node1 = m_value.First();
- wxNode* node2 = listData.GetValue().First();
+ wxNode* node1 = m_value.GetFirst();
+ wxNode* node2 = listData.GetValue().GetFirst();
while (node1 && node2)
{
- wxVariant* var1 = (wxVariant*) node1->Data();
- wxVariant* var2 = (wxVariant*) node2->Data();
+ wxVariant* var1 = (wxVariant*) node1->GetData();
+ wxVariant* var2 = (wxVariant*) node2->GetData();
if ((*var1) != (*var2))
- return FALSE;
- node1 = node1->Next();
- node2 = node2->Next();
+ return false;
+ node1 = node1->GetNext();
+ node2 = node2->GetNext();
}
- if (node1 || node2) return FALSE;
- return TRUE;
+ if (node1 || node2) return false;
+ return true;
}
#if wxUSE_STD_IOSTREAM
wxString s;
Write(s);
str << (const char*) s.mb_str();
- return TRUE;
+ return true;
}
#endif
bool wxVariantDataList::Write(wxString& str) const
{
str = wxT("");
- wxNode* node = m_value.First();
+ wxNode* node = m_value.GetFirst();
while (node)
{
- wxVariant* var = (wxVariant*) node->Data();
- if (node != m_value.First())
+ wxVariant* var = (wxVariant*) node->GetData();
+ if (node != m_value.GetFirst())
str += wxT(" ");
wxString str1;
str += var->MakeString();
- node = node->Next();
+ node = node->GetNext();
}
- return TRUE;
+ return true;
}
#if wxUSE_STD_IOSTREAM
{
wxFAIL_MSG(wxT("Unimplemented"));
// TODO
- return FALSE;
+ return false;
}
#endif
{
wxFAIL_MSG(wxT("Unimplemented"));
// TODO
- return FALSE;
+ return false;
}
/*
wxASSERT_MSG( (data.GetType() == wxT("stringlist")), wxT("wxVariantDataStringList::Eq: argument mismatch") );
wxVariantDataStringList& listData = (wxVariantDataStringList&) data;
- wxNode* node1 = m_value.First();
- wxNode* node2 = listData.GetValue().First();
+ wxStringList::Node *node1 = m_value.GetFirst();
+ wxStringList::Node *node2 = listData.GetValue().GetFirst();
while (node1 && node2)
{
- wxString str1 ((wxChar*) node1->Data());
- wxString str2 ((wxChar*) node2->Data());
+ wxString str1 ( node1->GetData() );
+ wxString str2 ( node2->GetData() );
if (str1 != str2)
- return FALSE;
- node1 = node1->Next();
- node2 = node2->Next();
+ return false;
+ node1 = node1->GetNext();
+ node2 = node2->GetNext();
}
- if (node1 || node2) return FALSE;
- return TRUE;
+ if (node1 || node2) return false;
+ return true;
}
#if wxUSE_STD_IOSTREAM
wxString s;
Write(s);
str << (const char*) s.mb_str();
- return TRUE;
+ return true;
}
#endif
bool wxVariantDataStringList::Write(wxString& str) const
{
- str = wxT("");
- wxNode* node = m_value.First();
+ str.Empty();
+ wxStringList::Node *node = m_value.GetFirst();
while (node)
{
- wxChar* s = (wxChar*) node->Data();
- if (node != m_value.First())
+ wxChar* s = node->GetData();
+ if (node != m_value.GetFirst())
str += wxT(" ");
str += s;
- node = node->Next();
+ node = node->GetNext();
}
- return TRUE;
+ return true;
}
#if wxUSE_STD_IOSTREAM
{
wxFAIL_MSG(wxT("Unimplemented"));
// TODO
- return FALSE;
+ return false;
}
#endif
{
wxFAIL_MSG(wxT("Unimplemented"));
// TODO
- return FALSE;
+ return false;
}
/*
wxString s;
Write(s);
str << (const char*) s.mb_str();
- return TRUE;
+ return true;
}
#endif
bool wxVariantDataLong::Write(wxString& str) const
{
str.Printf(wxT("%ld"), m_value);
- return TRUE;
+ return true;
}
#if wxUSE_STD_IOSTREAM
bool wxVariantDataLong::Read(wxSTD istream& str)
{
str >> m_value;
- return TRUE;
+ return true;
}
#endif
wxTextOutputStream s(str);
s.Write32((size_t)m_value);
- return TRUE;
+ return true;
}
bool wxVariantDataLong::Read(wxInputStream& str)
{
wxTextInputStream s(str);
m_value = s.Read32();
- return TRUE;
+ return true;
}
#endif // wxUSE_STREAMS
bool wxVariantDataLong::Read(wxString& str)
{
m_value = wxAtol((const wxChar*) str);
- return TRUE;
+ return true;
}
/*
wxString s;
Write(s);
str << (const char*) s.mb_str();
- return TRUE;
+ return true;
}
#endif
bool wxVariantDataReal::Write(wxString& str) const
{
str.Printf(wxT("%.4f"), m_value);
- return TRUE;
+ return true;
}
#if wxUSE_STD_IOSTREAM
bool wxVariantDataReal::Read(wxSTD istream& str)
{
str >> m_value;
- return TRUE;
+ return true;
}
#endif
{
wxTextOutputStream s(str);
s.WriteDouble((double)m_value);
- return TRUE;
+ return true;
}
bool wxVariantDataReal::Read(wxInputStream& str)
{
wxTextInputStream s(str);
m_value = (float)s.ReadDouble();
- return TRUE;
+ return true;
}
#endif // wxUSE_STREAMS
bool wxVariantDataReal::Read(wxString& str)
{
m_value = wxAtof((const wxChar*) str);
- return TRUE;
+ return true;
}
#ifdef HAVE_BOOL
wxString s;
Write(s);
str << (const char*) s.mb_str();
- return TRUE;
+ return true;
}
#endif
bool wxVariantDataBool::Write(wxString& str) const
{
str.Printf(wxT("%d"), (int) m_value);
- return TRUE;
+ return true;
}
#if wxUSE_STD_IOSTREAM
{
wxFAIL_MSG(wxT("Unimplemented"));
// str >> (long) m_value;
- return FALSE;
+ return false;
}
#endif
wxTextOutputStream s(str);
s.Write8(m_value);
- return TRUE;
+ return true;
}
bool wxVariantDataBool::Read(wxInputStream& str)
wxTextInputStream s(str);
m_value = s.Read8() != 0;
- return TRUE;
+ return true;
}
#endif // wxUSE_STREAMS
bool wxVariantDataBool::Read(wxString& str)
{
m_value = (wxAtol((const wxChar*) str) != 0);
- return TRUE;
+ return true;
}
#endif // HAVE_BOOL
wxString s;
Write(s);
str << (const char*) s.mb_str();
- return TRUE;
+ return true;
}
#endif
bool wxVariantDataChar::Write(wxString& str) const
{
str.Printf(wxT("%c"), m_value);
- return TRUE;
+ return true;
}
#if wxUSE_STD_IOSTREAM
{
wxFAIL_MSG(wxT("Unimplemented"));
// str >> m_value;
- return FALSE;
+ return false;
}
#endif
wxTextOutputStream s(str);
s.Write8(m_value);
- return TRUE;
+ return true;
}
bool wxVariantDataChar::Read(wxInputStream& str)
wxTextInputStream s(str);
m_value = s.Read8();
- return TRUE;
+ return true;
}
#endif // wxUSE_STREAMS
bool wxVariantDataChar::Read(wxString& str)
{
m_value = str[(size_t)0];
- return TRUE;
+ return true;
}
/*
bool wxVariantDataString::Write(wxSTD ostream& str) const
{
str << (const char*) m_value.mb_str();
- return TRUE;
+ return true;
}
#endif
bool wxVariantDataString::Write(wxString& str) const
{
str = m_value;
- return TRUE;
+ return true;
}
#if wxUSE_STD_IOSTREAM
bool wxVariantDataString::Read(wxSTD istream& str)
{
str >> m_value;
- return TRUE;
+ return true;
}
#endif
// why doesn't wxOutputStream::operator<< take "const wxString&"
wxTextOutputStream s(str);
s.WriteString(m_value);
- return TRUE;
+ return true;
}
bool wxVariantDataString::Read(wxInputStream& str)
wxTextInputStream s(str);
m_value = s.ReadString();
- return TRUE;
+ return true;
}
#endif // wxUSE_STREAMS
bool wxVariantDataString::Read(wxString& str)
{
m_value = str;
- return TRUE;
+ return true;
}
#if defined(__BORLANDC__) && defined(__WIN16__)
#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const { return wxT("time"); };
- virtual wxVariantData* Clone() { return new wxVariantDataTime; }
+ virtual wxVariantData* Clone() { return new wxVariantDataTime; }
protected:
wxTime m_value;
wxString s;
Write(s);
str << (const char*) s.mb_str();
- return TRUE;
+ return true;
}
#endif
{
wxChar*s = m_value.FormatTime();
str = s;
- return TRUE;
+ return true;
}
#if wxUSE_STD_IOSTREAM
bool wxVariantDataTime::Read(wxSTD istream& WXUNUSED(str))
{
// Not implemented
- return FALSE;
+ return false;
}
#endif
bool wxVariantDataTime::Read(wxString& WXUNUSED(str))
{
// Not implemented
- return FALSE;
+ return false;
}
/*
#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const { return wxT("date"); };
- virtual wxVariantData* Clone() { return new wxVariantDataDate; }
+ virtual wxVariantData* Clone() { return new wxVariantDataDate; }
protected:
wxDate m_value;
wxString s;
Write(s);
str << (const char*) s.mb_str();
- return TRUE;
+ return true;
}
#endif
bool wxVariantDataDate::Write(wxString& str) const
{
str = m_value.FormatDate();
- return TRUE;
+ return true;
}
#if wxUSE_STD_IOSTREAM
bool wxVariantDataDate::Read(wxSTD istream& WXUNUSED(str))
{
// Not implemented
- return FALSE;
+ return false;
}
#endif
bool wxVariantDataDate::Read(wxString& WXUNUSED(str))
{
// Not implemented
- return FALSE;
+ return false;
}
#endif
// wxUSE_TIMEDATE
#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const { return wxT("void*"); };
- virtual wxVariantData* Clone() { return new wxVariantDataVoidPtr; }
+ virtual wxVariantData* Clone() { return new wxVariantDataVoidPtr; }
protected:
void* m_value;
wxString s;
Write(s);
str << (const char*) s.mb_str();
- return TRUE;
+ return true;
}
#endif
bool wxVariantDataVoidPtr::Write(wxString& str) const
{
str.Printf(wxT("%ld"), (long) m_value);
- return TRUE;
+ return true;
}
#if wxUSE_STD_IOSTREAM
bool wxVariantDataVoidPtr::Read(wxSTD istream& WXUNUSED(str))
{
// Not implemented
- return FALSE;
+ return false;
}
#endif
bool wxVariantDataVoidPtr::Read(wxString& WXUNUSED(str))
{
// Not implemented
- return FALSE;
+ return false;
}
/*
bool wxVariantDataDateTime::Write(wxSTD ostream& str) const
{
// Not implemented
- return FALSE;
+ return false;
}
#endif
bool wxVariantDataDateTime::Write(wxString& str) const
{
str = m_value.Format();
- return TRUE;
+ return true;
}
bool wxVariantDataDateTime::Read(wxSTD istream& WXUNUSED(str))
{
// Not implemented
- return FALSE;
+ return false;
}
#endif
bool wxVariantDataDateTime::Read(wxString& str)
{
if(! m_value.ParseDateTime(str))
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
// ----------------------------------------------------------------------------
bool wxVariantDataArrayString::Write(wxSTD ostream& str) const
{
// Not implemented
- return FALSE;
+ return false;
}
#endif
str += m_value[n];
}
- return TRUE;
+ return true;
}
bool wxVariantDataArrayString::Read(wxSTD istream& WXUNUSED(str))
{
// Not implemented
- return FALSE;
+ return false;
}
#endif
m_value.Add(tk.GetNextToken());
}
- return TRUE;
+ return true;
}
{
double thisValue;
if (!Convert(&thisValue))
- return FALSE;
+ return false;
else
return (value == thisValue);
}
{
long thisValue;
if (!Convert(&thisValue))
- return FALSE;
+ return false;
else
return (value == thisValue);
}
{
char thisValue;
if (!Convert(&thisValue))
- return FALSE;
+ return false;
else
return (value == thisValue);
}
{
bool thisValue;
if (!Convert(&thisValue))
- return FALSE;
+ return false;
else
return (value == thisValue);
}
{
wxString thisValue;
if (!Convert(&thisValue))
- return FALSE;
+ return false;
return value == thisValue;
}
{
wxTime thisValue;
if (!Convert(&thisValue))
- return FALSE;
+ return false;
return value == thisValue;
}
{
wxDate thisValue;
if (!Convert(&thisValue))
- return FALSE;
+ return false;
return (value == thisValue);
}
{
wxDateTime thisValue;
if (!Convert(&thisValue))
- return FALSE;
+ return false;
return value.IsEqualTo(thisValue);
}
{
wxFAIL_MSG( _T("TODO") );
- return FALSE;
+ return false;
}
bool wxVariant::operator!=(const wxArrayString& value) const
if (GetType() == wxT("list"))
{
wxVariantDataList* data = (wxVariantDataList*) m_data;
- wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), wxT("Invalid index for array") );
- return * (wxVariant*) (data->GetValue().Nth(idx)->Data());
+ wxASSERT_MSG( (idx < (size_t) data->GetValue().GetCount()), wxT("Invalid index for array") );
+ return * (wxVariant*) (data->GetValue().Item(idx)->GetData());
}
else if (GetType() == wxT("stringlist"))
{
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 wxNullVariant;
wxASSERT_MSG( (GetType() == wxT("list")), wxT("Invalid type for array operator") );
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
if (GetType() == wxT("list"))
{
wxVariantDataList* data = (wxVariantDataList*) m_data;
- return data->GetValue().Number();
+ return data->GetValue().GetCount();
}
else if (GetType() == wxT("stringlist"))
{
wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
- return data->GetValue().Number();
+ return data->GetValue().GetCount();
}
return 0;
}
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
{
wxList& list = GetList();
- wxNode* node = list.First();
+ wxNode* node = list.GetFirst();
while (node)
{
- wxVariant* other = (wxVariant*) node->Data();
+ wxVariant* other = (wxVariant*) node->GetData();
if (value == *other)
- return TRUE;
- node = node->Next();
+ return true;
+ node = node->GetNext();
}
- return FALSE;
+ return false;
}
// Deletes the nth element of the list
{
wxList& list = GetList();
- wxASSERT_MSG( (item < list.Number()), wxT("Invalid index to Delete") );
- wxNode* node = list.Nth(item);
- wxVariant* variant = (wxVariant*) node->Data();
+ wxASSERT_MSG( (item < (int) list.GetCount()), wxT("Invalid index to Delete") );
+ wxNode* node = list.Item(item);
+ wxVariant* variant = (wxVariant*) node->GetData();
delete variant;
delete node;
- return TRUE;
+ return true;
}
// Clear list
else if (type == wxT("string"))
*value = wxAtol((const wxChar*) ((wxVariantDataString*)GetData())->GetValue());
else
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
bool wxVariant::Convert(bool* value) const
wxString val(((wxVariantDataString*)GetData())->GetValue());
val.MakeLower();
if (val == wxT("true") || val == wxT("yes"))
- *value = TRUE;
+ *value = true;
else if (val == wxT("false") || val == wxT("no"))
- *value = FALSE;
+ *value = false;
else
- return FALSE;
+ return false;
}
else
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
bool wxVariant::Convert(double* value) const
else if (type == wxT("string"))
*value = (double) wxAtof((const wxChar*) ((wxVariantDataString*)GetData())->GetValue());
else
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
bool wxVariant::Convert(char* value) const
*value = (char) (((wxVariantDataBool*)GetData())->GetValue());
#endif
else
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
bool wxVariant::Convert(wxString* value) const
{
*value = MakeString();
- return TRUE;
+ return true;
}
// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
else if (type == wxT("date"))
*value = wxTime(((wxVariantDataDate*)GetData())->GetValue());
else
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
bool wxVariant::Convert(wxDate* value) const
if (type == wxT("date"))
*value = ((wxVariantDataDate*)GetData())->GetValue();
else
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
#endif // wxUSE_TIMEDATE
if (type == wxT("datetime"))
{
*value = ((wxVariantDataDateTime*)GetData())->GetValue();
- return TRUE;
+ return true;
}
// Fallback to string conversion
wxString val;
double a, b, c, d, x1, y1, x2, y2, x3, y3;
wxPoint *p, *q;
- wxNode *node = points->First();
- p = (wxPoint *)node->Data();
+ wxNode *node = points->GetFirst();
+ p = (wxPoint *)node->GetData();
x1 = p->x;
y1 = p->y;
- node = node->Next();
- p = (wxPoint *)node->Data();
+ node = node->GetNext();
+ p = (wxPoint *)node->GetData();
c = p->x;
d = p->y;
x3 = a = (double)(x1 + c) / 2;
CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 );
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;
y1 = y3;
{
if(m_MapList)
{
- wxNode *node = m_MapList->First();
+ wxNode *node = m_MapList->GetFirst();
while (node)
{
- delete (wxExtHelpMapEntry *)node->Data();
+ delete (wxExtHelpMapEntry *)node->GetData();
delete node;
- node = m_MapList->First();
+ node = m_MapList->GetFirst();
}
delete m_MapList;
m_MapList = (wxList*) NULL;
return FALSE;
wxString contents;
- wxNode *node = m_MapList->First();
+ wxNode *node = m_MapList->GetFirst();
wxExtHelpMapEntry *entry;
while(node)
{
- entry = (wxExtHelpMapEntry *)node->Data();
+ entry = (wxExtHelpMapEntry *)node->GetData();
if(entry->id == CONTENTS_ID)
{
contents = entry->url;
break;
}
- node = node->Next();
+ node = node->GetNext();
}
bool rc = FALSE;
return FALSE;
wxBusyCursor b; // display a busy cursor
- wxNode *node = m_MapList->First();
+ wxNode *node = m_MapList->GetFirst();
wxExtHelpMapEntry *entry;
while(node)
{
- entry = (wxExtHelpMapEntry *)node->Data();
+ entry = (wxExtHelpMapEntry *)node->GetData();
if(entry->id == sectionNo)
return DisplayHelp(entry->url);
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
}
int idx = 0, j;
bool rc;
bool showAll = k.IsEmpty();
- wxNode *node = m_MapList->First();
+ wxNode *node = m_MapList->GetFirst();
wxExtHelpMapEntry *entry;
{
compA = k; compA.LowerCase(); // we compare case insensitive
while(node)
{
- entry = (wxExtHelpMapEntry *)node->Data();
+ entry = (wxExtHelpMapEntry *)node->GetData();
compB = entry->doc; compB.LowerCase();
if((showAll || compB.Contains(k)) && ! compB.IsEmpty())
{
choices[idx] << entry->doc.c_str()[j];
idx++;
}
- node = node->Next();
+ node = node->GetNext();
}
}
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) )
m_images.Append( new wxIcon( (const wxIcon&) bitmap ) );
else
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 )
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") );
- return (wxBitmap*)node->Data();
+ return (wxBitmap*)node->GetData();
}
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") );
else
newBitmap = new wxBitmap(bitmap) ;
- if (index == m_images.Number()-1)
+ if (index == (int) m_images.GetCount() - 1)
{
m_images.DeleteNode( node );
m_images.Append( newBitmap );
}
else
{
- wxNode *next = node->Next();
+ wxNode *next = node->GetNext();
m_images.DeleteNode( node );
m_images.Insert( next, newBitmap );
}
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") );
width = 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") );
- wxBitmap *bm = (wxBitmap*)node->Data();
+ wxBitmap *bm = (wxBitmap*)node->GetData();
width = bm->GetWidth();
height = bm->GetHeight();
bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y,
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") );
- wxBitmap *bm = (wxBitmap*)node->Data();
+ wxBitmap *bm = (wxBitmap*)node->GetData();
if (bm->IsKindOf(CLASSINFO(wxIcon)))
dc.DrawIcon( * ((wxIcon*) bm), x, y);
wxCalculateLayoutEvent event;
event.SetRect(rect);
- wxNode* node = frame->GetChildren().First();
+ wxWindowList::Node *node = frame->GetChildren().GetFirst();
while (node)
{
- wxWindow* win = (wxWindow*) node->Data();
+ wxWindow* win = node->GetData();
event.SetId(win->GetId());
event.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(event);
- node = node->Next();
+ node = node->GetNext();
}
wxWindow* clientWindow = frame->GetClientWindow();
// Find the last layout-aware window, so we can make it fill all remaining
// space.
- wxWindow* lastAwareWindow = NULL;
- wxNode* node = parent->GetChildren().First();
+ wxWindow *lastAwareWindow = NULL;
+ wxWindowList::Node *node = parent->GetChildren().GetFirst();
+
while (node)
{
- wxWindow* win = (wxWindow*) node->Data();
+ wxWindow* win = node->GetData();
if (win->IsShown())
{
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)
- node = parent->GetChildren().First();
+ node = parent->GetChildren().GetFirst();
while (node)
{
- wxWindow* win = (wxWindow*) node->Data();
+ wxWindow* win = node->GetData();
// If mainWindow is NULL and we're at the last window,
// skip this, because we'll simply make it fit the remaining space.
win->GetEventHandler()->ProcessEvent(event);
}
- node = node->Next();
+ node = node->GetNext();
}
if (event.GetRect().GetWidth() < 0 || event.GetRect().GetHeight() < 0)
event.SetRect(rect);
- node = parent->GetChildren().First();
+ node = parent->GetChildren().GetFirst();
while (node)
{
- wxWindow* win = (wxWindow*) node->Data();
+ wxWindow* win = node->GetData();
// If mainWindow is NULL and we're at the last window,
// skip this, because we'll simply make it fit the remaining space.
win->GetEventHandler()->ProcessEvent(event);
}
- node = node->Next();
+ node = node->GetNext();
}
rect = event.GetRect();
2, choices,
1, wxRA_VERTICAL);
m_rangeRadioBox->SetSelection(1);
-
+
mainsizer->Add( m_rangeRadioBox, 0, wxLEFT|wxTOP|wxRIGHT, 10 );
}
wxThePrintPaperDatabase->CreateDatabase();
}
*/
- int n = wxThePrintPaperDatabase->Number();
- wxString *choices = new wxString [n];
- int sel = 0;
- int i;
- for (i = 0; i < n; i++)
+ size_t n = wxThePrintPaperDatabase->GetCount();
+ wxString *choices = new wxString [n];
+ size_t sel = 0;
+
+ 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();
if (m_printData.GetPaperId() == paper->GetId())
sel = i;
int width = 250;
- wxComboBox *choice = new wxComboBox(this, wxPRINTID_PAPERSIZE,
- _("Paper Size"),
- wxPoint(*x, *y), wxSize(width, -1), n,
- choices);
+ wxComboBox *choice = new wxComboBox( this,
+ wxPRINTID_PAPERSIZE,
+ _("Paper Size"),
+ wxPoint(*x, *y),
+ wxSize(width, -1),
+ n, choices );
// SetFont(thisFont);
TransferDataToWindow();
}
-wxGenericPageSetupDialog::wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data):
-wxDialog(parent, -1, _("Page Setup"), wxPoint(0, 0), wxSize(600, 600), wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL)
+wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
+ wxPageSetupData* data)
+ : wxDialog( parent,
+ -1,
+ _("Page Setup"),
+ wxPoint(0, 0),
+ wxSize(600, 600),
+ wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL )
{
if (data)
m_pageData = *data;
-
+
int textWidth = 80;
-
+
wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );
-
+
// 1) top
wxStaticBoxSizer *topsizer = new wxStaticBoxSizer(
new wxStaticBox(this,wxPRINTID_STATIC, _("Paper size")), wxHORIZONTAL );
-
- int n = wxThePrintPaperDatabase->Number();
- wxString *choices = new wxString [n];
- int i;
- for (i = 0; i < n; i++)
+
+ size_t n = wxThePrintPaperDatabase->GetCount();
+ wxString *choices = new wxString [n];
+
+ 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();
}
- m_paperTypeChoice = new wxComboBox(this, wxPRINTID_PAPERSIZE, _("Paper Size"),
- wxDefaultPosition, wxSize(300, -1), n, choices);
+ m_paperTypeChoice = new wxComboBox( this,
+ wxPRINTID_PAPERSIZE,
+ _("Paper Size"),
+ wxDefaultPosition,
+ wxSize(300, -1),
+ n, choices );
topsizer->Add( m_paperTypeChoice, 1, wxEXPAND|wxALL, 5 );
// m_paperTypeChoice->SetSelection(sel);
}
*/
- int n = wxThePrintPaperDatabase->Number();
- wxString *choices = new wxString [n];
- int i;
- for (i = 0; i < n; i++)
+ size_t n = wxThePrintPaperDatabase->GetCount();
+ wxString *choices = new wxString [n];
+
+ 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();
}
(void) new wxStaticText(this, wxPRINTID_STATIC, _("Paper size"), wxPoint(*x, *y));
*y += 25;
- wxComboBox *choice = new wxComboBox(this, wxPRINTID_PAPERSIZE,
- _("Paper Size"),
- wxPoint(*x, *y), wxSize(300, -1), n,
- choices);
+ wxComboBox *choice = new wxComboBox( this,
+ wxPRINTID_PAPERSIZE,
+ _("Paper Size"),
+ wxPoint(*x, *y),
+ wxSize(300, -1),
+ n, choices );
*y += 35;
delete[] choices;
m_last = NULL;
m_value.first = NULL;
- wxNode *node = the_list->First();
+ wxNode *node = the_list->GetFirst();
while (node)
{
- wxPropertyValue *expr = (wxPropertyValue *)node->Data();
+ wxPropertyValue *expr = (wxPropertyValue *)node->GetData();
Append(expr);
- node = node->Next();
+ node = node->GetNext();
}
delete the_list;
m_last = NULL;
m_value.first = NULL;
- wxNode *node = the_list->First();
+ wxStringList::Node *node = the_list->GetFirst();
while (node)
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
Append(new wxPropertyValue(s));
- node = node->Next();
+ node = node->GetNext();
}
delete the_list;
}
if (property->GetValidator())
return property->GetValidator();
- wxNode *node = m_validatorRegistryList.First();
+ wxNode *node = m_validatorRegistryList.GetFirst();
while (node)
{
- wxPropertyValidatorRegistry *registry = (wxPropertyValidatorRegistry *)node->Data();
+ wxPropertyValidatorRegistry *registry = (wxPropertyValidatorRegistry *)node->GetData();
wxPropertyValidator *validator = registry->GetValidator(property->GetRole());
if (validator)
return validator;
- node = node->Next();
+ node = node->GetNext();
}
return NULL;
/*
if (!node)
return NULL;
else
- return (wxProperty *)node->Data();
+ return (wxProperty *)node->GetData();
}
bool wxPropertySheet::SetProperty(const wxString& name, const wxPropertyValue& value)
wxNode *node = m_properties.Find(name);
if(node)
{
- wxProperty *prop = (wxProperty *)node->Data();
+ wxProperty *prop = (wxProperty *)node->GetData();
delete prop;
m_properties.DeleteNode(node);
}
// Clear all properties
void wxPropertySheet::Clear(void)
{
- wxNode *node = m_properties.First();
+ wxNode *node = m_properties.GetFirst();
while (node)
{
- wxProperty *prop = (wxProperty *)node->Data();
- wxNode *next = node->Next();
+ wxProperty *prop = (wxProperty *)node->GetData();
+ wxNode *next = node->GetNext();
delete prop;
delete node;
node = next;
// Sets/clears the modified flag for each property value
void wxPropertySheet::SetAllModified(bool flag)
{
- wxNode *node = m_properties.First();
+ wxNode *node = m_properties.GetFirst();
while (node)
{
- wxProperty *prop = (wxProperty *)node->Data();
+ wxProperty *prop = (wxProperty *)node->GetData();
prop->GetValue().SetModified(flag);
- node = node->Next();
+ node = node->GetNext();
}
}
wxNode *node;
while ((node = Next()) != NULL)
{
- delete (wxPropertyValidator *)node->Data();
+ delete (wxPropertyValidator *)node->GetData();
}
}
if (!m_propertySheet)
return FALSE;
- wxNode *node = m_propertySheet->GetProperties().First();
+ wxNode *node = m_propertySheet->GetProperties().GetFirst();
while (node)
{
- wxProperty *prop = (wxProperty *)node->Data();
+ wxProperty *prop = (wxProperty *)node->GetData();
wxPropertyValidator *validator = FindPropertyValidator(prop);
if (validator && validator->IsKindOf(CLASSINFO(wxPropertyFormValidator)))
{
if (!formValidator->OnCheckValue(prop, this, m_propertyWindow))
return FALSE;
}
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}
if (!m_propertySheet)
return FALSE;
- wxNode *node = m_propertySheet->GetProperties().First();
+ wxNode *node = m_propertySheet->GetProperties().GetFirst();
while (node)
{
- wxProperty *prop = (wxProperty *)node->Data();
+ wxProperty *prop = (wxProperty *)node->GetData();
wxPropertyValidator *validator = FindPropertyValidator(prop);
if (validator && validator->IsKindOf(CLASSINFO(wxPropertyFormValidator)))
{
wxPropertyFormValidator *formValidator = (wxPropertyFormValidator *)validator;
formValidator->OnRetrieveValue(prop, this, m_propertyWindow);
}
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}
if (!m_propertySheet)
return FALSE;
- wxNode *node = m_propertySheet->GetProperties().First();
+ wxNode *node = m_propertySheet->GetProperties().GetFirst();
while (node)
{
- wxProperty *prop = (wxProperty *)node->Data();
+ wxProperty *prop = (wxProperty *)node->GetData();
wxPropertyValidator *validator = FindPropertyValidator(prop);
if (validator && validator->IsKindOf(CLASSINFO(wxPropertyFormValidator)))
{
wxPropertyFormValidator *formValidator = (wxPropertyFormValidator *)validator;
formValidator->OnDisplayValue(prop, this, m_propertyWindow);
}
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}
if (!m_propertySheet || !m_propertyWindow)
return FALSE;
- wxNode *node = m_propertyWindow->GetChildren().First();
+ wxWindowList::Node *node = m_propertyWindow->GetChildren().GetFirst();
while (node)
{
- wxWindow *win = (wxWindow *)node->Data();
- if (win->GetName() != wxT(""))
+ wxWindow *win = node->GetData();
+ if ( win->GetName() != wxEmptyString )
{
wxProperty *prop = m_propertySheet->GetProperty(win->GetName());
if (prop)
prop->SetWindow(win);
}
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}
else
{
// Find a validator to route the command to.
- wxNode *node = m_propertySheet->GetProperties().First();
+ wxNode *node = m_propertySheet->GetProperties().GetFirst();
while (node)
{
- wxProperty *prop = (wxProperty *)node->Data();
+ wxProperty *prop = (wxProperty *)node->GetData();
if (prop->GetWindow() && (prop->GetWindow() == &win))
{
wxPropertyValidator *validator = FindPropertyValidator(prop);
return;
}
}
- node = node->Next();
+ node = node->GetNext();
}
}
}
return;
// Find a validator to route the command to.
- wxNode *node = m_propertySheet->GetProperties().First();
+ wxNode *node = m_propertySheet->GetProperties().GetFirst();
while (node)
{
- wxProperty *prop = (wxProperty *)node->Data();
+ wxProperty *prop = (wxProperty *)node->GetData();
if (prop->GetWindow() && ((wxControl *)prop->GetWindow() == item))
{
wxPropertyValidator *validator = FindPropertyValidator(prop);
return;
}
}
- node = node->Next();
+ node = node->GetNext();
}
}
if (lbox->GetCount() == 0 && m_strings)
{
// Try to initialize the listbox from 'strings'
- wxNode *node = m_strings->First();
+ wxStringList::Node *node = m_strings->GetFirst();
while (node)
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
lbox->Append(s);
- node = node->Next();
+ node = node->GetNext();
}
}
lbox->SetStringSelection(property->GetValue().StringValue());
{
// Try to initialize the choice item from 'strings'
// XView doesn't allow this kind of thing.
- wxNode *node = m_strings->First();
+ wxStringList::Node *node = m_strings->GetFirst();
while (node)
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
choice->Append(s);
- node = node->Next();
+ node = node->GetNext();
}
}
choice->SetStringSelection(property->GetValue().StringValue());
m_valueList->Clear();
m_valueText->SetValue( wxT("") );
}
- wxNode *node = m_propertySheet->GetProperties().First();
+ wxNode *node = m_propertySheet->GetProperties().GetFirst();
// Should sort them... later...
while (node)
{
- wxProperty *property = (wxProperty *)node->Data();
+ wxProperty *property = (wxProperty *)node->GetData();
wxString stringValueRepr(property->GetValue().GetStringRepresentation());
wxString paddedString(MakeNameValueString(property->GetName(), stringValueRepr));
m_propertyScrollingList->Append(paddedString.GetData(), (void *)property);
- node = node->Next();
+ node = node->GetNext();
}
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())
{
view->ShowListBoxControl(TRUE);
view->GetValueList()->Enable(TRUE);
- wxNode *node = m_strings->First();
+ wxStringList::Node *node = m_strings->GetFirst();
while (node)
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
view->GetValueList()->Append(s);
- node = node->Next();
+ node = node->GetNext();
}
wxChar *currentString = property->GetValue().StringValue();
view->GetValueList()->SetStringSelection(currentString);
// Called when the property is double clicked. Extra functionality can be provided,
// 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())
return FALSE;
if (!m_strings)
return FALSE;
- wxNode *node = m_strings->First();
- wxChar *currentString = property->GetValue().StringValue();
+ wxStringList::Node *node = m_strings->GetFirst();
+ wxChar *currentString = property->GetValue().StringValue();
while (node)
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
if (wxStrcmp(s, currentString) == 0)
{
wxChar *nextString = NULL;
- if (node->Next())
- nextString = (wxChar *)node->Next()->Data();
+ if (node->GetNext())
+ nextString = node->GetNext()->GetData();
else
- nextString = (wxChar *)m_strings->First()->Data();
+ nextString = m_strings->GetFirst()->GetData();
property->GetValue() = wxString(nextString);
view->DisplayProperty(property);
view->UpdatePropertyDisplayInList(property);
view->OnPropertyChanged(property);
return TRUE;
}
- else node = node->Next();
+ else node = node->GetNext();
}
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
wxStringList *stringList = new wxStringList;
{
wxPropertyValue& oldValue = property->GetValue();
oldValue.ClearList();
- wxNode *node = stringList->First();
+ wxStringList::Node *node = stringList->GetFirst();
while (node)
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
oldValue.Append(new wxPropertyValue(s));
- node = node->Next();
+ node = node->GetNext();
}
view->DisplayProperty(property);
c->height.AsIs();
okButton->SetConstraints(c);
- wxNode *node = stringList->First();
+ wxStringList::Node *node = stringList->GetFirst();
while (node)
{
- wxChar *str = (wxChar *)node->Data();
+ wxChar *str = node->GetData();
// Save node as client data for each listbox item
dialog->m_listBox->Append(str, (wxChar *)node);
- node = node->Next();
+ node = node->GetNext();
}
dialog->SetClientSize(310, 305);
return;
m_listBox->Delete(sel);
- delete[] (wxChar *)node->Data();
+ delete[] (wxChar *)node->GetData();
delete node;
m_currentSelection = -1;
m_stringText->SetValue(_T(""));
wxString initialText;
wxNode *node = m_stringList->Add(initialText);
m_listBox->Append(initialText, (void *)node);
- m_currentSelection = m_stringList->Number() - 1;
+ m_currentSelection = m_stringList->GetCount() - 1;
m_listBox->SetSelection(m_currentSelection);
ShowCurrentSelection();
m_stringText->SetFocus();
return;
wxString txt(m_stringText->GetValue());
- if (node->Data())
- delete[] (wxChar *)node->Data();
+ if (node->GetData())
+ delete[] (wxChar *)node->GetData();
node->SetData((wxObject *)wxStrdup(txt));
- m_listBox->SetString(m_currentSelection, (wxChar *)node->Data());
+ m_listBox->SetString(m_currentSelection, (wxChar *)node->GetData());
}
void wxPropertyStringListEditorDialog::ShowCurrentSelection()
return;
}
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->Enable(TRUE);
}
int 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 y = 0;
child->SetSize(x, y, width, height);
}
- else if (GetChildren().Number() > 1)
+ else if (GetChildren().GetCount() > 1)
{
// Perhaps multiple children are themselves sash windows.
// TODO: this doesn't really work because the subwindows sizes/positions
{
wxList children;
GetChildren(nodeId, children);
- int n = children.Number();
+ int n = children.GetCount();
if (m_orientation == FALSE)
{
SetNodeX(nodeId, (long)(GetNodeX(parentId) + m_xSpacing + x));
}
- wxNode *node = children.First();
+ wxNode *node = children.GetFirst();
while (node)
{
- CalcLayout((long)node->Data(), level+1, dc);
- node = node->Next();
+ CalcLayout((long)node->GetData(), level+1, dc);
+ node = node->GetNext();
}
// Y Calculations
if (n > 0)
{
averageY = 0;
- node = children.First();
+ node = children.GetFirst();
while (node)
{
- averageY += GetNodeY((long)node->Data());
- node = node->Next();
+ averageY += GetNodeY((long)node->GetData());
+ node = node->GetNext();
}
averageY = averageY / n;
SetNodeY(nodeId, averageY);
SetNodeY(nodeId, (long)(GetNodeY(parentId) + m_ySpacing + y));
}
- wxNode *node = children.First();
+ wxNode *node = children.GetFirst();
while (node)
{
- CalcLayout((long)node->Data(), level+1, dc);
- node = node->Next();
+ CalcLayout((long)node->GetData(), level+1, dc);
+ node = node->GetNext();
}
// X Calculations
if (n > 0)
{
averageX = 0;
- node = children.First();
+ node = children.GetFirst();
while (node)
{
- averageX += GetNodeX((long)node->Data());
- node = node->Next();
+ averageX += GetNodeX((long)node->GetData());
+ node = node->GetNext();
}
averageX = averageX / n;
SetNodeX(nodeId, averageX);
// But repaint the assertion message if necessary
if (wxTopLevelWindows.GetCount() > 0)
{
- wxWindow* win = (wxWindow*) wxTopLevelWindows.Last()->Data();
+ wxWindow* win = (wxWindow*) wxTopLevelWindows.GetLast()->GetData();
if (win->IsKindOf(CLASSINFO(wxGenericMessageDialog)))
win->OnInternalIdle();
}
{
win->OnInternalIdle();
- wxNode* node = win->GetChildren().First();
+ wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node)
{
- wxWindow* win = (wxWindow*) node->Data();
- CallInternalIdle( win );
+ wxWindow *win = node->GetData();
- node = node->Next();
+ CallInternalIdle( win );
+ node = node->GetNext();
}
return TRUE;
if (event.MoreRequested())
needMore = TRUE;
- wxNode* node = win->GetChildren().First();
+ wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node)
{
- wxWindow* win = (wxWindow*) node->Data();
+ wxWindow *win = node->GetData();
+
if (SendIdleEvents(win))
needMore = TRUE;
-
- node = node->Next();
+ node = node->GetNext();
}
return needMore;
void wxApp::DeletePendingObjects()
{
- wxNode *node = wxPendingDelete.First();
+ wxNode *node = wxPendingDelete.GetFirst();
while (node)
{
- wxObject *obj = (wxObject *)node->Data();
+ wxObject *obj = (wxObject *)node->GetData();
delete obj;
if (wxPendingDelete.Find(obj))
delete node;
- node = wxPendingDelete.First();
+ node = wxPendingDelete.GetFirst();
}
}
{
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") );
node->SetData( (wxObject*) clientData );
{
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") );
- return node->Data();
+ return node->GetData();
}
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
{
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") );
// wxItemContainer already deletes data for us
{
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,
wxT("invalid index in wxChoice::DoGetItemClientObject") );
- return (wxClientData*) node->Data();
+ return (wxClientData*) node->GetData();
}
void wxChoice::Clear()
// destroy the data (due to Robert's idea of using wxList<wxObject>
// and not wxList<wxClientData> we can't just say
// m_clientList.DeleteContents(TRUE) - this would crash!
- wxNode *node = m_clientList.First();
+ wxNode *node = m_clientList.GetFirst();
while ( node )
{
- delete (wxClientData *)node->Data();
- node = node->Next();
+ delete (wxClientData *)node->GetData();
+ node = node->GetNext();
}
}
m_clientList.Clear();
wxNode *node = (wxNode *) NULL;
if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
{
- wxColour *col = (wxColour*)node->Data();
+ wxColour *col = (wxColour*)node->GetData();
UnRef();
if (col) Ref( *col );
}
wxComboBox::~wxComboBox()
{
- wxNode *node = m_clientObjectList.First();
+ wxNode *node = m_clientObjectList.GetFirst();
while (node)
{
- wxClientData *cd = (wxClientData*)node->Data();
+ wxClientData *cd = (wxClientData*)node->GetData();
if (cd) delete cd;
- node = node->Next();
+ node = node->GetNext();
}
m_clientObjectList.Clear();
{
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
- wxNode *node = m_clientDataList.Nth( n );
+ wxNode *node = m_clientDataList.Item( n );
if (!node) return;
node->SetData( (wxObject*) clientData );
{
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;
- return node->Data();
+ return node->GetData();
}
void wxComboBox::SetClientObject( int n, wxClientData* clientData )
{
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
- wxNode *node = m_clientObjectList.Nth( n );
+ wxNode *node = m_clientObjectList.Item( n );
if (!node) return;
- wxClientData *cd = (wxClientData*) node->Data();
+ wxClientData *cd = (wxClientData*) node->GetData();
if (cd) delete cd;
node->SetData( (wxObject*) clientData );
{
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;
- return (wxClientData*) node->Data();
+ return (wxClientData*) node->GetData();
}
void wxComboBox::Clear()
GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_clear_items( GTK_LIST(list), 0, Number() );
- wxNode *node = m_clientObjectList.First();
+ wxNode *node = m_clientObjectList.GetFirst();
while (node)
{
- wxClientData *cd = (wxClientData*)node->Data();
+ wxClientData *cd = (wxClientData*)node->GetData();
if (cd) delete cd;
- node = node->Next();
+ node = node->GetNext();
}
m_clientObjectList.Clear();
gtk_list_remove_items( listbox, list );
g_list_free( list );
- wxNode *node = m_clientObjectList.Nth( n );
+ wxNode *node = m_clientObjectList.Item( n );
if (node)
{
- wxClientData *cd = (wxClientData*)node->Data();
+ wxClientData *cd = (wxClientData*)node->GetData();
if (cd) delete cd;
m_clientObjectList.DeleteNode( node );
}
- node = m_clientDataList.Nth( n );
+ node = m_clientDataList.Item( n );
if (node)
{
m_clientDataList.DeleteNode( node );
if (index != GetCount())
{
GtkAddItem( items[n], index );
- wxNode *node = m_clientList.Nth( index );
+ wxNode *node = m_clientList.Item( index );
m_clientList.Insert( node, (wxObject*) NULL );
}
else
}
else
{
- wxNode *node = m_clientList.Nth( pos );
+ wxNode *node = m_clientList.Item( pos );
for ( size_t n = 0; n < nItems; n++ )
{
GtkAddItem( items[n], pos+n );
{
GtkAddItem( item, index );
- wxNode *node = m_clientList.Nth( index );
+ wxNode *node = m_clientList.Item( index );
m_clientList.Insert( node, (wxObject *)NULL );
return index;
// destroy the data (due to Robert's idea of using wxList<wxObject>
// and not wxList<wxClientData> we can't just say
// m_clientList.DeleteContents(TRUE) - this would crash!
- wxNode *node = m_clientList.First();
+ wxNode *node = m_clientList.GetFirst();
while ( node )
{
- delete (wxClientData *)node->Data();
- node = node->Next();
+ delete (wxClientData *)node->GetData();
+ node = node->GetNext();
}
}
m_clientList.Clear();
gtk_list_remove_items( m_list, list );
g_list_free( list );
- wxNode *node = m_clientList.Nth( n );
+ wxNode *node = m_clientList.Item( n );
if ( node )
{
if ( m_clientDataItemsType == wxClientData_Object )
{
- wxClientData *cd = (wxClientData*)node->Data();
+ wxClientData *cd = (wxClientData*)node->GetData();
delete cd;
}
{
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") );
node->SetData( (wxObject*) clientData );
{
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") );
- return node->Data();
+ return node->GetData();
}
void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData )
{
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") );
// wxItemContainer already deletes data for us
{
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,
wxT("invalid index in wxListBox::DoGetItemClientObject") );
- return (wxClientData*) node->Data();
+ return (wxClientData*) node->GetData();
}
// ----------------------------------------------------------------------------
wxMDIChildFrame *child = parent->GetActiveChild();
if (child)
{
- wxActivateEvent event1( wxEVT_ACTIVATE, FALSE, child->GetId() );
+ wxActivateEvent event1( wxEVT_ACTIVATE, false, child->GetId() );
event1.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event1 );
}
child = (wxMDIChildFrame*) NULL;
- wxNode *node = client_window->GetChildren().First();
+ wxWindowList::Node *node = client_window->GetChildren().GetFirst();
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)
{
child = child_frame;
break;
}
- node = node->Next();
+ node = node->GetNext();
}
if (!child)
return;
- wxActivateEvent event2( wxEVT_ACTIVATE, TRUE, child->GetId() );
+ wxActivateEvent event2( wxEVT_ACTIVATE, true, child->GetId() );
event2.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event2 );
}
void wxMDIParentFrame::Init()
{
- m_justInserted = FALSE;
+ m_justInserted = false;
m_clientWindow = (wxMDIClientWindow *) NULL;
}
OnCreateClient();
- return TRUE;
+ return true;
}
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget);
gtk_notebook_set_page( notebook, g_list_length( notebook->children ) - 1 );
- m_justInserted = FALSE;
+ m_justInserted = false;
return;
}
wxFrame::OnInternalIdle();
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)
{
- wxObject *child = node->Data();
- wxMDIChildFrame *child_frame = wxDynamicCast(child, wxMDIChildFrame);
+ wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
+
if ( child_frame )
{
wxMenuBar *menu_bar = child_frame->m_menuBar;
{
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_height = wxMENU_HEIGHT;
0, 0, m_width, wxMENU_HEIGHT );
menu_bar->SetInvokingWindow( child_frame );
}
- visible_child_menu = TRUE;
+ visible_child_menu = true;
}
else
{
- if (menu_bar->Show(FALSE))
+ if (menu_bar->Show(false))
{
menu_bar->UnsetInvokingWindow( child_frame );
}
}
}
- node = node->Next();
+ node = node->GetNext();
}
/* show/hide parent menu bar as required */
{
if (visible_child_menu)
{
- m_frameMenuBar->Show( FALSE );
+ m_frameMenuBar->Show( false );
m_frameMenuBar->UnsetInvokingWindow( this );
}
else
{
- m_frameMenuBar->Show( TRUE );
+ m_frameMenuBar->Show( true );
m_frameMenuBar->SetInvokingWindow( this );
m_frameMenuBar->m_width = m_width;
GtkNotebookPage* page = (GtkNotebookPage*) (g_list_nth(notebook->children,i)->data);
if (!page) return (wxMDIChildFrame*) NULL;
- wxNode *node = m_clientWindow->GetChildren().First();
+ wxWindowList::Node *node = m_clientWindow->GetChildren().GetFirst();
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)
return child_frame;
- node = node->Next();
+ node = node->GetNext();
}
return (wxMDIChildFrame*) NULL;
child->m_page = (GtkNotebookPage*) (g_list_last(notebook->children)->data);
wxMDIParentFrame *parent_frame = (wxMDIParentFrame*) parent->GetParent();
- parent_frame->m_justInserted = TRUE;
+ parent_frame->m_justInserted = true;
}
//-----------------------------------------------------------------------------
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
{
- m_needParent = TRUE;
+ m_needParent = true;
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") ))
{
wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") );
- return FALSE;
+ return false;
}
m_widget = gtk_notebook_new();
PostCreation();
- Show( TRUE );
+ Show( true );
- return TRUE;
+ return true;
}
#endif
int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
{
- wxNode *node = m_items.First();
+ wxMenuItemList::Node *node = m_items.GetFirst();
while (node)
{
- wxMenuItem *item = (wxMenuItem*)node->Data();
+ wxMenuItem *item = node->GetData();
if (item->GetMenuItem() == menuItem)
return item->GetId();
- node = node->Next();
+ node = node->GetNext();
}
return wxNOT_FOUND;
if ((gdk_event->keyval == GDK_Up) ||
(gdk_event->keyval == GDK_Left))
{
- if (node == rb->m_boxes.First())
- node = rb->m_boxes.Last();
+ if (node == rb->m_boxes.GetFirst())
+ node = rb->m_boxes.GetLast();
else
- node = node->Previous();
+ node = node->GetPrevious();
}
else
{
- if (node == rb->m_boxes.Last())
- node = rb->m_boxes.First();
+ if (node == rb->m_boxes.GetLast())
+ node = rb->m_boxes.GetFirst();
else
- node = node->Next();
+ node = node->GetNext();
}
- GtkWidget *button = (GtkWidget*) node->Data();
+ GtkWidget *button = (GtkWidget*) node->GetData();
gtk_widget_grab_focus( button );
wxRadioBox::~wxRadioBox()
{
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkWidget *button = GTK_WIDGET( node->Data() );
+ GtkWidget *button = GTK_WIDGET( node->GetData() );
gtk_widget_destroy( button );
- node = node->Next();
+ node = node->GetNext();
}
}
y = 15;
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++)
{
- GtkWidget *button = GTK_WIDGET( node->Data() );
+ GtkWidget *button = GTK_WIDGET( node->GetData() );
GtkRequisition req;
req.width = 2;
gtk_pizza_move( GTK_PIZZA(m_parent->m_wxwindow), button, m_x+x, m_y+y );
y += req.height;
- node = node->Next();
+ node = node->GetNext();
if (!node) break;
}
// 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++)
{
- 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 );
- node = node->Next();
+ node = node->GetNext();
if (!node) break;
}
{
int max = 0;
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkWidget *button = GTK_WIDGET( node->Data() );
+ GtkWidget *button = GTK_WIDGET( node->GetData() );
GtkRequisition req;
req.width = 2;
if (req.width > max) max = req.width;
- node = node->Next();
+ node = node->GetNext();
}
- node = m_boxes.First();
+ node = m_boxes.GetFirst();
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 );
x += max;
- node = node->Next();
+ node = node->GetNext();
}
res.x = x+4;
res.y = 40;
if ((m_windowStyle & wxNO_BORDER) != 0)
gtk_widget_hide( m_widget );
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
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 );
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
int count = 0;
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
#ifdef __WXGTK20__
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
#else
count++;
- node = node->Next();
+ node = node->GetNext();
}
return -1;
if (m_boxes.GetCount() == 0) return;
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
+ GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
if (button->active)
{
gtk_widget_grab_focus( GTK_WIDGET(button) );
return;
}
- node = node->Next();
+ node = node->GetNext();
}
}
{
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") );
- GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
+ GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
GtkDisableEvents();
int count = 0;
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
+ GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
if (button->active) return count;
count++;
- node = node->Next();
+ node = node->GetNext();
}
wxFAIL_MSG( wxT("wxRadioBox none selected") );
{
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") );
- GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
#ifdef __WXGTK20__
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
{
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") );
- 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 ) );
}
if ( !wxControl::Enable( enable ) )
return FALSE;
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkButton *button = GTK_BUTTON( node->Data() );
+ GtkButton *button = GTK_BUTTON( node->GetData() );
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
gtk_widget_set_sensitive( GTK_WIDGET(label), enable );
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
{
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") );
- GtkButton *button = GTK_BUTTON( node->Data() );
+ GtkButton *button = GTK_BUTTON( node->GetData() );
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
{
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") );
- GtkWidget *button = GTK_WIDGET( node->Data() );
+ GtkWidget *button = GTK_WIDGET( node->GetData() );
if (show)
gtk_widget_show( button );
{
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") );
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
+ GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
if (button->active)
{
- GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
#ifdef __WXGTK20__
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
#endif
return str;
}
- node = node->Next();
+ node = node->GetNext();
}
wxFAIL_MSG( wxT("wxRadioBox none selected") );
int wxRadioBox::GetCount() const
{
- return m_boxes.Number();
+ return m_boxes.GetCount();
}
int wxRadioBox::GetNumberOfRowsOrCols() const
void wxRadioBox::GtkDisableEvents()
{
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
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 );
- node = node->Next();
+ node = node->GetNext();
}
}
void wxRadioBox::GtkEnableEvents()
{
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
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 );
- node = node->Next();
+ node = node->GetNext();
}
}
gtk_widget_set_style( m_widget, m_widgetStyle );
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
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( 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
void wxRadioBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
{
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
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 );
- node = node->Next();
+ node = node->GetNext();
}
}
#endif // wxUSE_TOOLTIPS
{
if (window == m_widget->window) return TRUE;
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkWidget *button = GTK_WIDGET( node->Data() );
+ GtkWidget *button = GTK_WIDGET( node->GetData() );
if (window == button->window) return TRUE;
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
yy += pizza->yoffset;
}
- wxNode *node = win->GetChildren().First();
+ wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node)
{
- wxWindowGTK *child = (wxWindowGTK*)node->Data();
+ wxWindowGTK *child = node->GetData();
- node = node->Next();
+ node = node->GetNext();
if (!child->IsShown())
continue;
// But repaint the assertion message if necessary
if (wxTopLevelWindows.GetCount() > 0)
{
- wxWindow* win = (wxWindow*) wxTopLevelWindows.Last()->Data();
+ wxWindow* win = (wxWindow*) wxTopLevelWindows.GetLast()->GetData();
if (win->IsKindOf(CLASSINFO(wxGenericMessageDialog)))
win->OnInternalIdle();
}
{
win->OnInternalIdle();
- wxNode* node = win->GetChildren().First();
+ wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node)
{
- wxWindow* win = (wxWindow*) node->Data();
- CallInternalIdle( win );
+ wxWindow *win = node->GetData();
- node = node->Next();
+ CallInternalIdle( win );
+ node = node->GetNext();
}
return TRUE;
if (event.MoreRequested())
needMore = TRUE;
- wxNode* node = win->GetChildren().First();
+ wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node)
{
- wxWindow* win = (wxWindow*) node->Data();
+ wxWindow *win = node->GetData();
+
if (SendIdleEvents(win))
needMore = TRUE;
-
- node = node->Next();
+ node = node->GetNext();
}
return needMore;
void wxApp::DeletePendingObjects()
{
- wxNode *node = wxPendingDelete.First();
+ wxNode *node = wxPendingDelete.GetFirst();
while (node)
{
- wxObject *obj = (wxObject *)node->Data();
+ wxObject *obj = (wxObject *)node->GetData();
delete obj;
if (wxPendingDelete.Find(obj))
delete node;
- node = wxPendingDelete.First();
+ node = wxPendingDelete.GetFirst();
}
}
{
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") );
node->SetData( (wxObject*) clientData );
{
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") );
- return node->Data();
+ return node->GetData();
}
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
{
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") );
// wxItemContainer already deletes data for us
{
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,
wxT("invalid index in wxChoice::DoGetItemClientObject") );
- return (wxClientData*) node->Data();
+ return (wxClientData*) node->GetData();
}
void wxChoice::Clear()
// destroy the data (due to Robert's idea of using wxList<wxObject>
// and not wxList<wxClientData> we can't just say
// m_clientList.DeleteContents(TRUE) - this would crash!
- wxNode *node = m_clientList.First();
+ wxNode *node = m_clientList.GetFirst();
while ( node )
{
- delete (wxClientData *)node->Data();
- node = node->Next();
+ delete (wxClientData *)node->GetData();
+ node = node->GetNext();
}
}
m_clientList.Clear();
wxNode *node = (wxNode *) NULL;
if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
{
- wxColour *col = (wxColour*)node->Data();
+ wxColour *col = (wxColour*)node->GetData();
UnRef();
if (col) Ref( *col );
}
wxComboBox::~wxComboBox()
{
- wxNode *node = m_clientObjectList.First();
+ wxNode *node = m_clientObjectList.GetFirst();
while (node)
{
- wxClientData *cd = (wxClientData*)node->Data();
+ wxClientData *cd = (wxClientData*)node->GetData();
if (cd) delete cd;
- node = node->Next();
+ node = node->GetNext();
}
m_clientObjectList.Clear();
{
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
- wxNode *node = m_clientDataList.Nth( n );
+ wxNode *node = m_clientDataList.Item( n );
if (!node) return;
node->SetData( (wxObject*) clientData );
{
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;
- return node->Data();
+ return node->GetData();
}
void wxComboBox::SetClientObject( int n, wxClientData* clientData )
{
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
- wxNode *node = m_clientObjectList.Nth( n );
+ wxNode *node = m_clientObjectList.Item( n );
if (!node) return;
- wxClientData *cd = (wxClientData*) node->Data();
+ wxClientData *cd = (wxClientData*) node->GetData();
if (cd) delete cd;
node->SetData( (wxObject*) clientData );
{
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;
- return (wxClientData*) node->Data();
+ return (wxClientData*) node->GetData();
}
void wxComboBox::Clear()
GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_clear_items( GTK_LIST(list), 0, Number() );
- wxNode *node = m_clientObjectList.First();
+ wxNode *node = m_clientObjectList.GetFirst();
while (node)
{
- wxClientData *cd = (wxClientData*)node->Data();
+ wxClientData *cd = (wxClientData*)node->GetData();
if (cd) delete cd;
- node = node->Next();
+ node = node->GetNext();
}
m_clientObjectList.Clear();
gtk_list_remove_items( listbox, list );
g_list_free( list );
- wxNode *node = m_clientObjectList.Nth( n );
+ wxNode *node = m_clientObjectList.Item( n );
if (node)
{
- wxClientData *cd = (wxClientData*)node->Data();
+ wxClientData *cd = (wxClientData*)node->GetData();
if (cd) delete cd;
m_clientObjectList.DeleteNode( node );
}
- node = m_clientDataList.Nth( n );
+ node = m_clientDataList.Item( n );
if (node)
{
m_clientDataList.DeleteNode( node );
if (index != GetCount())
{
GtkAddItem( items[n], index );
- wxNode *node = m_clientList.Nth( index );
+ wxNode *node = m_clientList.Item( index );
m_clientList.Insert( node, (wxObject*) NULL );
}
else
}
else
{
- wxNode *node = m_clientList.Nth( pos );
+ wxNode *node = m_clientList.Item( pos );
for ( size_t n = 0; n < nItems; n++ )
{
GtkAddItem( items[n], pos+n );
{
GtkAddItem( item, index );
- wxNode *node = m_clientList.Nth( index );
+ wxNode *node = m_clientList.Item( index );
m_clientList.Insert( node, (wxObject *)NULL );
return index;
// destroy the data (due to Robert's idea of using wxList<wxObject>
// and not wxList<wxClientData> we can't just say
// m_clientList.DeleteContents(TRUE) - this would crash!
- wxNode *node = m_clientList.First();
+ wxNode *node = m_clientList.GetFirst();
while ( node )
{
- delete (wxClientData *)node->Data();
- node = node->Next();
+ delete (wxClientData *)node->GetData();
+ node = node->GetNext();
}
}
m_clientList.Clear();
gtk_list_remove_items( m_list, list );
g_list_free( list );
- wxNode *node = m_clientList.Nth( n );
+ wxNode *node = m_clientList.Item( n );
if ( node )
{
if ( m_clientDataItemsType == wxClientData_Object )
{
- wxClientData *cd = (wxClientData*)node->Data();
+ wxClientData *cd = (wxClientData*)node->GetData();
delete cd;
}
{
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") );
node->SetData( (wxObject*) clientData );
{
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") );
- return node->Data();
+ return node->GetData();
}
void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData )
{
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") );
// wxItemContainer already deletes data for us
{
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,
wxT("invalid index in wxListBox::DoGetItemClientObject") );
- return (wxClientData*) node->Data();
+ return (wxClientData*) node->GetData();
}
// ----------------------------------------------------------------------------
wxMDIChildFrame *child = parent->GetActiveChild();
if (child)
{
- wxActivateEvent event1( wxEVT_ACTIVATE, FALSE, child->GetId() );
+ wxActivateEvent event1( wxEVT_ACTIVATE, false, child->GetId() );
event1.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event1 );
}
child = (wxMDIChildFrame*) NULL;
- wxNode *node = client_window->GetChildren().First();
+ wxWindowList::Node *node = client_window->GetChildren().GetFirst();
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)
{
child = child_frame;
break;
}
- node = node->Next();
+ node = node->GetNext();
}
if (!child)
return;
- wxActivateEvent event2( wxEVT_ACTIVATE, TRUE, child->GetId() );
+ wxActivateEvent event2( wxEVT_ACTIVATE, true, child->GetId() );
event2.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event2 );
}
void wxMDIParentFrame::Init()
{
- m_justInserted = FALSE;
+ m_justInserted = false;
m_clientWindow = (wxMDIClientWindow *) NULL;
}
OnCreateClient();
- return TRUE;
+ return true;
}
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget);
gtk_notebook_set_page( notebook, g_list_length( notebook->children ) - 1 );
- m_justInserted = FALSE;
+ m_justInserted = false;
return;
}
wxFrame::OnInternalIdle();
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)
{
- wxObject *child = node->Data();
- wxMDIChildFrame *child_frame = wxDynamicCast(child, wxMDIChildFrame);
+ wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
+
if ( child_frame )
{
wxMenuBar *menu_bar = child_frame->m_menuBar;
{
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_height = wxMENU_HEIGHT;
0, 0, m_width, wxMENU_HEIGHT );
menu_bar->SetInvokingWindow( child_frame );
}
- visible_child_menu = TRUE;
+ visible_child_menu = true;
}
else
{
- if (menu_bar->Show(FALSE))
+ if (menu_bar->Show(false))
{
menu_bar->UnsetInvokingWindow( child_frame );
}
}
}
- node = node->Next();
+ node = node->GetNext();
}
/* show/hide parent menu bar as required */
{
if (visible_child_menu)
{
- m_frameMenuBar->Show( FALSE );
+ m_frameMenuBar->Show( false );
m_frameMenuBar->UnsetInvokingWindow( this );
}
else
{
- m_frameMenuBar->Show( TRUE );
+ m_frameMenuBar->Show( true );
m_frameMenuBar->SetInvokingWindow( this );
m_frameMenuBar->m_width = m_width;
GtkNotebookPage* page = (GtkNotebookPage*) (g_list_nth(notebook->children,i)->data);
if (!page) return (wxMDIChildFrame*) NULL;
- wxNode *node = m_clientWindow->GetChildren().First();
+ wxWindowList::Node *node = m_clientWindow->GetChildren().GetFirst();
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)
return child_frame;
- node = node->Next();
+ node = node->GetNext();
}
return (wxMDIChildFrame*) NULL;
child->m_page = (GtkNotebookPage*) (g_list_last(notebook->children)->data);
wxMDIParentFrame *parent_frame = (wxMDIParentFrame*) parent->GetParent();
- parent_frame->m_justInserted = TRUE;
+ parent_frame->m_justInserted = true;
}
//-----------------------------------------------------------------------------
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
{
- m_needParent = TRUE;
+ m_needParent = true;
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") ))
{
wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") );
- return FALSE;
+ return false;
}
m_widget = gtk_notebook_new();
PostCreation();
- Show( TRUE );
+ Show( true );
- return TRUE;
+ return true;
}
#endif
int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
{
- wxNode *node = m_items.First();
+ wxMenuItemList::Node *node = m_items.GetFirst();
while (node)
{
- wxMenuItem *item = (wxMenuItem*)node->Data();
+ wxMenuItem *item = node->GetData();
if (item->GetMenuItem() == menuItem)
return item->GetId();
- node = node->Next();
+ node = node->GetNext();
}
return wxNOT_FOUND;
if ((gdk_event->keyval == GDK_Up) ||
(gdk_event->keyval == GDK_Left))
{
- if (node == rb->m_boxes.First())
- node = rb->m_boxes.Last();
+ if (node == rb->m_boxes.GetFirst())
+ node = rb->m_boxes.GetLast();
else
- node = node->Previous();
+ node = node->GetPrevious();
}
else
{
- if (node == rb->m_boxes.Last())
- node = rb->m_boxes.First();
+ if (node == rb->m_boxes.GetLast())
+ node = rb->m_boxes.GetFirst();
else
- node = node->Next();
+ node = node->GetNext();
}
- GtkWidget *button = (GtkWidget*) node->Data();
+ GtkWidget *button = (GtkWidget*) node->GetData();
gtk_widget_grab_focus( button );
wxRadioBox::~wxRadioBox()
{
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkWidget *button = GTK_WIDGET( node->Data() );
+ GtkWidget *button = GTK_WIDGET( node->GetData() );
gtk_widget_destroy( button );
- node = node->Next();
+ node = node->GetNext();
}
}
y = 15;
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++)
{
- GtkWidget *button = GTK_WIDGET( node->Data() );
+ GtkWidget *button = GTK_WIDGET( node->GetData() );
GtkRequisition req;
req.width = 2;
gtk_pizza_move( GTK_PIZZA(m_parent->m_wxwindow), button, m_x+x, m_y+y );
y += req.height;
- node = node->Next();
+ node = node->GetNext();
if (!node) break;
}
// 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++)
{
- 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 );
- node = node->Next();
+ node = node->GetNext();
if (!node) break;
}
{
int max = 0;
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkWidget *button = GTK_WIDGET( node->Data() );
+ GtkWidget *button = GTK_WIDGET( node->GetData() );
GtkRequisition req;
req.width = 2;
if (req.width > max) max = req.width;
- node = node->Next();
+ node = node->GetNext();
}
- node = m_boxes.First();
+ node = m_boxes.GetFirst();
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 );
x += max;
- node = node->Next();
+ node = node->GetNext();
}
res.x = x+4;
res.y = 40;
if ((m_windowStyle & wxNO_BORDER) != 0)
gtk_widget_hide( m_widget );
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
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 );
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
int count = 0;
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
#ifdef __WXGTK20__
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
#else
count++;
- node = node->Next();
+ node = node->GetNext();
}
return -1;
if (m_boxes.GetCount() == 0) return;
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
+ GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
if (button->active)
{
gtk_widget_grab_focus( GTK_WIDGET(button) );
return;
}
- node = node->Next();
+ node = node->GetNext();
}
}
{
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") );
- GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
+ GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
GtkDisableEvents();
int count = 0;
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
+ GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
if (button->active) return count;
count++;
- node = node->Next();
+ node = node->GetNext();
}
wxFAIL_MSG( wxT("wxRadioBox none selected") );
{
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") );
- GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
#ifdef __WXGTK20__
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
{
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") );
- 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 ) );
}
if ( !wxControl::Enable( enable ) )
return FALSE;
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkButton *button = GTK_BUTTON( node->Data() );
+ GtkButton *button = GTK_BUTTON( node->GetData() );
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
gtk_widget_set_sensitive( GTK_WIDGET(label), enable );
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
{
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") );
- GtkButton *button = GTK_BUTTON( node->Data() );
+ GtkButton *button = GTK_BUTTON( node->GetData() );
GtkLabel *label = GTK_LABEL( BUTTON_CHILD(button) );
gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
{
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") );
- GtkWidget *button = GTK_WIDGET( node->Data() );
+ GtkWidget *button = GTK_WIDGET( node->GetData() );
if (show)
gtk_widget_show( button );
{
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid radiobox") );
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
+ GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData() );
if (button->active)
{
- GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
+ GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->GetData()) );
#ifdef __WXGTK20__
wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
#endif
return str;
}
- node = node->Next();
+ node = node->GetNext();
}
wxFAIL_MSG( wxT("wxRadioBox none selected") );
int wxRadioBox::GetCount() const
{
- return m_boxes.Number();
+ return m_boxes.GetCount();
}
int wxRadioBox::GetNumberOfRowsOrCols() const
void wxRadioBox::GtkDisableEvents()
{
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
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 );
- node = node->Next();
+ node = node->GetNext();
}
}
void wxRadioBox::GtkEnableEvents()
{
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
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 );
- node = node->Next();
+ node = node->GetNext();
}
}
gtk_widget_set_style( m_widget, m_widgetStyle );
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
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( 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
void wxRadioBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
{
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
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 );
- node = node->Next();
+ node = node->GetNext();
}
}
#endif // wxUSE_TOOLTIPS
{
if (window == m_widget->window) return TRUE;
- wxNode *node = m_boxes.First();
+ wxNode *node = m_boxes.GetFirst();
while (node)
{
- GtkWidget *button = GTK_WIDGET( node->Data() );
+ GtkWidget *button = GTK_WIDGET( node->GetData() );
if (window == button->window) return TRUE;
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
yy += pizza->yoffset;
}
- wxNode *node = win->GetChildren().First();
+ wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node)
{
- wxWindowGTK *child = (wxWindowGTK*)node->Data();
+ wxWindowGTK *child = node->GetData();
- node = node->Next();
+ node = node->GetNext();
if (!child->IsShown())
continue;