Split this out from other changes to keep things sane..
wxDeprecated KeyCode. wxDeprecated old wxList compat methods. Replaced a large number of them in the gtk build already, but there are still plenty more so feel free to help nuke them as you find them. s/^I/ / and s/TRUE/true/ etc. a couple of these too. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -20,6 +20,30 @@ All:
|
||||
- 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:
|
||||
|
||||
|
@@ -91,7 +91,7 @@ public:
|
||||
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();
|
||||
|
@@ -155,10 +155,10 @@ public:
|
||||
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:
|
||||
@@ -191,6 +191,8 @@ private:
|
||||
// a double-linked list class
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
class wxList;
|
||||
|
||||
class WXDLLEXPORT wxListBase : public wxObject
|
||||
{
|
||||
friend class WXDLLEXPORT wxNodeBase; // should be able to call DetachNode()
|
||||
@@ -232,10 +234,14 @@ public:
|
||||
{ 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:
|
||||
@@ -502,6 +508,9 @@ private:
|
||||
|
||||
#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
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -511,7 +520,12 @@ WX_DECLARE_LIST_2(wxObject, wxObjectList, wxObjectListNode, class WXDLLEXPORT);
|
||||
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() { }
|
||||
|
||||
@@ -538,8 +552,13 @@ class WXDLLEXPORT wxStringList : public wxStringListBase
|
||||
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!)
|
||||
|
@@ -383,7 +383,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
||||
|
||||
void MyCanvas::OnChar( wxKeyEvent &event )
|
||||
{
|
||||
switch ( event.KeyCode() )
|
||||
switch ( event.GetKeyCode() )
|
||||
{
|
||||
case WXK_LEFT:
|
||||
PrevChar();
|
||||
@@ -415,9 +415,9 @@ void MyCanvas::OnChar( wxKeyEvent &event )
|
||||
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);
|
||||
|
@@ -1690,7 +1690,7 @@ void MyComboBox::OnChar(wxKeyEvent& event)
|
||||
{
|
||||
wxLogMessage(_T("MyComboBox::OnChar"));
|
||||
|
||||
if ( event.KeyCode() == 'w' )
|
||||
if ( event.GetKeyCode() == 'w' )
|
||||
wxLogMessage(_T("MyComboBox: 'w' will be ignored."));
|
||||
else
|
||||
event.Skip();
|
||||
@@ -1700,7 +1700,7 @@ void MyComboBox::OnKeyDown(wxKeyEvent& event)
|
||||
{
|
||||
wxLogMessage(_T("MyComboBox::OnKeyDown"));
|
||||
|
||||
if ( event.KeyCode() == 'w' )
|
||||
if ( event.GetKeyCode() == 'w' )
|
||||
wxLogMessage(_T("MyComboBox: 'w' will be ignored."));
|
||||
else
|
||||
event.Skip();
|
||||
|
@@ -50,17 +50,17 @@ wxSTD ostream& DrawingDocument::SaveObject(wxSTD ostream& stream)
|
||||
{
|
||||
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;
|
||||
@@ -72,17 +72,17 @@ wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& 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;
|
||||
@@ -133,10 +133,10 @@ DoodleSegment::DoodleSegment(void)
|
||||
|
||||
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;
|
||||
@@ -145,7 +145,7 @@ DoodleSegment::DoodleSegment(DoodleSegment& seg)
|
||||
|
||||
lines.Append(newLine);
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,18 +157,18 @@ DoodleSegment::~DoodleSegment(void)
|
||||
#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;
|
||||
@@ -178,18 +178,18 @@ wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& 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;
|
||||
@@ -238,12 +238,12 @@ wxInputStream &DoodleSegment::LoadObject(wxInputStream& 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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,13 +272,13 @@ bool DrawingCommand::Do(void)
|
||||
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);
|
||||
@@ -318,10 +318,10 @@ bool DrawingCommand::Undo(void)
|
||||
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;
|
||||
|
||||
|
@@ -90,12 +90,12 @@ void DrawingView::OnDraw(wxDC *dc)
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
|
||||
if (currentSegment && event.LeftUp())
|
||||
{
|
||||
if (currentSegment->lines.Number() == 0)
|
||||
if (currentSegment->lines.GetCount() == 0)
|
||||
{
|
||||
delete currentSegment;
|
||||
currentSegment = (DoodleSegment *) NULL;
|
||||
|
@@ -48,17 +48,17 @@ wxSTD ostream& DrawingDocument::SaveObject(wxSTD ostream& stream)
|
||||
{
|
||||
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;
|
||||
@@ -70,17 +70,17 @@ wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& 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;
|
||||
@@ -130,10 +130,10 @@ DoodleSegment::DoodleSegment(void)
|
||||
|
||||
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;
|
||||
@@ -142,7 +142,7 @@ DoodleSegment::DoodleSegment(DoodleSegment& seg)
|
||||
|
||||
lines.Append(newLine);
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,18 +154,18 @@ DoodleSegment::~DoodleSegment(void)
|
||||
#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;
|
||||
@@ -175,18 +175,18 @@ wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& 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;
|
||||
@@ -234,12 +234,12 @@ wxInputStream &DoodleSegment::LoadObject(wxInputStream& 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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,13 +268,13 @@ bool DrawingCommand::Do(void)
|
||||
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);
|
||||
@@ -314,10 +314,10 @@ bool DrawingCommand::Undo(void)
|
||||
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;
|
||||
|
||||
|
@@ -69,12 +69,12 @@ void DrawingView::OnDraw(wxDC *dc)
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
|
||||
if (currentSegment && event.LeftUp())
|
||||
{
|
||||
if (currentSegment->lines.Number() == 0)
|
||||
if (currentSegment->lines.GetCount() == 0)
|
||||
{
|
||||
delete currentSegment;
|
||||
currentSegment = (DoodleSegment *) NULL;
|
||||
|
@@ -270,13 +270,13 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,25 +295,25 @@ void MyCanvas::EraseShape(DragShape* shape, wxDC& dc)
|
||||
|
||||
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;
|
||||
}
|
||||
|
@@ -357,7 +357,7 @@ void TestGLCanvas::Action( long code, unsigned long lasttime,
|
||||
|
||||
void TestGLCanvas::OnKeyDown( wxKeyEvent& event )
|
||||
{
|
||||
long evkey = event.KeyCode();
|
||||
long evkey = event.GetKeyCode();
|
||||
if (evkey == 0) return;
|
||||
|
||||
if (!m_TimeInitialized)
|
||||
|
@@ -379,7 +379,7 @@ void TestGLCanvas::OnSize(wxSizeEvent& event)
|
||||
|
||||
void TestGLCanvas::OnChar(wxKeyEvent& event)
|
||||
{
|
||||
switch(event.KeyCode()) {
|
||||
switch(event.GetKeyCode()) {
|
||||
case WXK_ESCAPE:
|
||||
exit(0);
|
||||
case WXK_LEFT:
|
||||
|
@@ -424,7 +424,7 @@ bool MyTextCtrl::ms_logFocus = FALSE;
|
||||
void MyTextCtrl::LogKeyEvent(const wxChar *name, wxKeyEvent& event) const
|
||||
{
|
||||
wxString key;
|
||||
long keycode = event.KeyCode();
|
||||
long keycode = event.GetKeyCode();
|
||||
{
|
||||
switch ( keycode )
|
||||
{
|
||||
@@ -696,7 +696,7 @@ void MyTextCtrl::OnKeyUp(wxKeyEvent& event)
|
||||
|
||||
void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
|
||||
{
|
||||
switch ( event.KeyCode() )
|
||||
switch ( event.GetKeyCode() )
|
||||
{
|
||||
case WXK_F1:
|
||||
// show current position and text length
|
||||
|
@@ -854,7 +854,7 @@ TREE_EVENT_HANDLER(OnSelChanging)
|
||||
void LogKeyEvent(const wxChar *name, const wxKeyEvent& event)
|
||||
{
|
||||
wxString key;
|
||||
long keycode = event.KeyCode();
|
||||
long keycode = event.GetKeyCode();
|
||||
{
|
||||
switch ( keycode )
|
||||
{
|
||||
|
@@ -212,10 +212,10 @@ void wxAppBase::ProcessPendingEvents()
|
||||
}
|
||||
|
||||
// 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
|
||||
@@ -224,7 +224,7 @@ void wxAppBase::ProcessPendingEvents()
|
||||
handler->ProcessPendingEvents();
|
||||
wxENTER_CRIT_SECT( *wxPendingEventsLocker );
|
||||
|
||||
node = wxPendingEvents->First();
|
||||
node = wxPendingEvents->GetFirst();
|
||||
}
|
||||
|
||||
wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
|
||||
|
@@ -112,10 +112,10 @@ void wxCommandProcessor::Store(wxCommand *command)
|
||||
{
|
||||
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;
|
||||
}
|
||||
@@ -126,18 +126,18 @@ void wxCommandProcessor::Store(wxCommand *command)
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ bool wxCommandProcessor::Undo()
|
||||
{
|
||||
if ( UndoCommand(*command) )
|
||||
{
|
||||
m_currentCommand = m_currentCommand->Previous();
|
||||
m_currentCommand = m_currentCommand->GetPrevious();
|
||||
SetMenuStrings();
|
||||
return TRUE;
|
||||
}
|
||||
@@ -165,18 +165,18 @@ bool wxCommandProcessor::Redo()
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,13 +202,13 @@ bool wxCommandProcessor::CanUndo() const
|
||||
|
||||
bool wxCommandProcessor::CanRedo() const
|
||||
{
|
||||
if ((m_currentCommand != (wxNode*) NULL) && (m_currentCommand->Next() == (wxNode*) NULL))
|
||||
if ((m_currentCommand != (wxNode*) NULL) && (m_currentCommand->GetNext() == (wxNode*) NULL))
|
||||
return FALSE;
|
||||
|
||||
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;
|
||||
@@ -216,7 +216,7 @@ bool wxCommandProcessor::CanRedo() const
|
||||
|
||||
void wxCommandProcessor::Initialize()
|
||||
{
|
||||
m_currentCommand = m_commands.Last();
|
||||
m_currentCommand = m_commands.GetLast();
|
||||
SetMenuStrings();
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ wxString wxCommandProcessor::GetUndoMenuLabel() const
|
||||
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();
|
||||
@@ -267,9 +267,9 @@ wxString wxCommandProcessor::GetRedoMenuLabel() const
|
||||
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;
|
||||
@@ -281,7 +281,7 @@ wxString wxCommandProcessor::GetRedoMenuLabel() const
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_commands.Number() == 0)
|
||||
if (m_commands.GetCount() == 0)
|
||||
{
|
||||
buf = _("&Redo") + m_redoAccelerator;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ wxString wxCommandProcessor::GetRedoMenuLabel() const
|
||||
{
|
||||
// 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;
|
||||
@@ -300,13 +300,13 @@ wxString wxCommandProcessor::GetRedoMenuLabel() const
|
||||
|
||||
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;
|
||||
}
|
||||
|
@@ -69,13 +69,13 @@ void wxDCBase::DoDrawCheckMark(wxCoord x1, wxCoord y1,
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -90,13 +90,13 @@ void wxDCBase::DrawPolygon(const wxList *list,
|
||||
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;
|
||||
}
|
||||
@@ -131,9 +131,9 @@ void wxDCBase::DrawSpline(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoor
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -254,13 +254,13 @@ static bool wx_spline_add_point(double x, double y)
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,14 +272,14 @@ void wxDCBase::DoDrawSpline( wxList *points )
|
||||
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;
|
||||
@@ -290,9 +290,9 @@ void wxDCBase::DoDrawSpline( wxList *points )
|
||||
|
||||
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;
|
||||
|
@@ -181,14 +181,14 @@ bool wxDocument::DeleteAllViews()
|
||||
{
|
||||
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;
|
||||
@@ -203,9 +203,9 @@ bool wxDocument::DeleteAllViews()
|
||||
|
||||
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
|
||||
@@ -275,12 +275,12 @@ bool wxDocument::SaveAs()
|
||||
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);
|
||||
@@ -498,7 +498,7 @@ bool wxDocument::OnCreate(const wxString& WXUNUSED(path), long flags)
|
||||
// there are no more views.
|
||||
void wxDocument::OnChangedViewList()
|
||||
{
|
||||
if (m_documentViews.Number() == 0)
|
||||
if (m_documentViews.GetCount() == 0)
|
||||
{
|
||||
if (OnSaveModified())
|
||||
{
|
||||
@@ -509,24 +509,24 @@ void wxDocument::OnChangedViewList()
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -536,12 +536,12 @@ void wxDocument::SetFilename(const wxString& filename, bool notifyViews)
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -774,11 +774,11 @@ wxDocManager::~wxDocManager()
|
||||
|
||||
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;
|
||||
@@ -804,11 +804,11 @@ bool wxDocManager::Clear(bool force)
|
||||
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;
|
||||
}
|
||||
@@ -1029,9 +1029,9 @@ wxView *wxDocManager::GetCurrentView() const
|
||||
{
|
||||
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;
|
||||
@@ -1051,12 +1051,12 @@ bool wxDocManager::ProcessEvent(wxEvent& event)
|
||||
|
||||
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;
|
||||
@@ -1071,9 +1071,9 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
|
||||
|
||||
// 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
|
||||
@@ -1162,12 +1162,12 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
|
||||
|
||||
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())
|
||||
@@ -1335,10 +1335,9 @@ wxDocTemplate *wxDocManager::FindTemplateForPath(const wxString& path)
|
||||
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;
|
||||
@@ -1951,14 +1950,14 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
|
||||
// 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 ++;
|
||||
}
|
||||
@@ -1994,12 +1993,12 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2019,10 +2018,10 @@ void wxFileHistory::RemoveFileFromHistory(int i)
|
||||
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
|
||||
@@ -2033,7 +2032,7 @@ void wxFileHistory::RemoveFileFromHistory(int i)
|
||||
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))
|
||||
@@ -2118,10 +2117,10 @@ void wxFileHistory::AddFilesToMenu()
|
||||
{
|
||||
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++)
|
||||
@@ -2133,7 +2132,7 @@ void wxFileHistory::AddFilesToMenu()
|
||||
menu->Append(wxID_FILE1+i, buf);
|
||||
}
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -633,19 +633,19 @@ wxEvtHandler::~wxEvtHandler()
|
||||
|
||||
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;
|
||||
};
|
||||
@@ -730,10 +730,10 @@ void wxEvtHandler::ProcessPendingEvents()
|
||||
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
|
||||
@@ -751,7 +751,7 @@ void wxEvtHandler::ProcessPendingEvents()
|
||||
wxENTER_CRIT_SECT( *m_eventsLocker);
|
||||
#endif
|
||||
|
||||
node = m_pendingEvents->First();
|
||||
node = m_pendingEvents->GetFirst();
|
||||
}
|
||||
|
||||
#if defined(__VISAGECPP__)
|
||||
@@ -996,13 +996,13 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
|
||||
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) &&
|
||||
@@ -1017,7 +1017,7 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
|
||||
delete entry;
|
||||
return TRUE;
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1029,13 +1029,13 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
|
||||
|
||||
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)
|
||||
@@ -1058,7 +1058,7 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return FALSE;
|
||||
};
|
||||
|
@@ -260,9 +260,9 @@ void wxPathList::EnsureFileAccessible (const wxString& path)
|
||||
|
||||
bool wxPathList::Member (const wxString& path)
|
||||
{
|
||||
for (wxNode * node = First (); node != NULL; node = node->Next ())
|
||||
for (wxStringList::Node *node = GetFirst(); node; node = node->GetNext())
|
||||
{
|
||||
wxString path2((wxChar *) node->Data ());
|
||||
wxString path2( node->GetData() );
|
||||
if (
|
||||
#if defined(__WINDOWS__) || defined(__VMS__) || defined (__WXMAC__)
|
||||
// Case INDEPENDENT
|
||||
@@ -272,9 +272,9 @@ bool wxPathList::Member (const wxString& path)
|
||||
path.CompareTo (path2) == 0
|
||||
#endif
|
||||
)
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
wxString wxPathList::FindValidPath (const wxString& file)
|
||||
@@ -288,9 +288,9 @@ wxString wxPathList::FindValidPath (const wxString& file)
|
||||
wxChar *filename = (wxChar*) NULL; /* shut up buggy egcs warning */
|
||||
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('/'))
|
||||
@@ -305,7 +305,7 @@ wxString wxPathList::FindValidPath (const wxString& file)
|
||||
}
|
||||
} // for()
|
||||
|
||||
return wxString(wxT("")); // Not found
|
||||
return wxEmptyString; // Not found
|
||||
}
|
||||
|
||||
wxString wxPathList::FindAbsoluteValidPath (const wxString& file)
|
||||
@@ -354,23 +354,23 @@ wxIsAbsolutePath (const wxString& filename)
|
||||
// "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 ;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -549,7 +549,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
|
||||
s = nm;
|
||||
d = lnm;
|
||||
#ifdef __WXMSW__
|
||||
q = FALSE;
|
||||
q = false;
|
||||
#else
|
||||
q = nm[0] == wxT('\\') && nm[1] == wxT('~');
|
||||
#endif
|
||||
@@ -865,8 +865,8 @@ wxString wxMacFSSpec2MacFilename( const FSSpec *spec )
|
||||
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];
|
||||
@@ -944,7 +944,7 @@ static char sMacFileNameConversion[ 1000 ] ;
|
||||
#endif
|
||||
void wxMacFilename2FSSpec( const char *path , FSSpec *spec )
|
||||
{
|
||||
OSStatus err = noErr ;
|
||||
OSStatus err = noErr ;
|
||||
#ifdef __DARWIN__
|
||||
FSRef theRef;
|
||||
|
||||
@@ -953,9 +953,9 @@ void wxMacFilename2FSSpec( const char *path , FSSpec *spec )
|
||||
// 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 , ":" ) ;
|
||||
@@ -963,7 +963,7 @@ void wxMacFilename2FSSpec( const char *path , FSSpec *spec )
|
||||
}
|
||||
else
|
||||
{
|
||||
err = FSpLocationFromFullPath( strlen(path) , path , spec ) ;
|
||||
err = FSpLocationFromFullPath( strlen(path) , path , spec ) ;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1088,7 +1088,7 @@ wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& fil
|
||||
{
|
||||
wxString outfile;
|
||||
if ( !wxGetTempFileName( wxT("cat"), outfile) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
FILE *fp1 = (FILE *) NULL;
|
||||
FILE *fp2 = (FILE *) NULL;
|
||||
@@ -1104,7 +1104,7 @@ wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& fil
|
||||
fclose (fp2);
|
||||
if (fp3)
|
||||
fclose (fp3);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
int ch;
|
||||
@@ -1135,11 +1135,11 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
|
||||
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;
|
||||
@@ -1150,13 +1150,13 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
|
||||
// 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
|
||||
@@ -1164,7 +1164,7 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
|
||||
{
|
||||
wxLogSysError(_("Impossible to overwrite the file '%s'"),
|
||||
file2.c_str());
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef __UNIX__
|
||||
@@ -1178,7 +1178,7 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
|
||||
|
||||
wxFile fileOut;
|
||||
if ( !fileOut.Create(file2, overwrite, fbuf.st_mode & 0777) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
#ifdef __UNIX__
|
||||
/// restore the old umask
|
||||
@@ -1192,21 +1192,21 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
|
||||
{
|
||||
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
|
||||
@@ -1215,12 +1215,12 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
|
||||
{
|
||||
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
|
||||
@@ -1228,15 +1228,15 @@ wxRenameFile (const wxString& file1, const wxString& file2)
|
||||
{
|
||||
// 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)
|
||||
@@ -1282,23 +1282,23 @@ bool wxMkdir(const wxString& dir, int perm)
|
||||
{
|
||||
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
|
||||
@@ -1434,14 +1434,14 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
|
||||
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
|
||||
@@ -1455,11 +1455,11 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
|
||||
#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
|
||||
|
||||
@@ -1488,11 +1488,11 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
|
||||
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;
|
||||
@@ -1620,7 +1620,7 @@ bool wxEndsWithPathSeparator(const wxChar *pszFileName)
|
||||
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
|
||||
@@ -1691,13 +1691,13 @@ bool wxIsWild( const wxString& pattern )
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1729,7 +1729,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
|
||||
{
|
||||
/* Never match so that hidden Unix files
|
||||
* are never found. */
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (;;)
|
||||
@@ -1746,7 +1746,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
|
||||
{
|
||||
m++;
|
||||
if (!*n++)
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1755,7 +1755,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
|
||||
m++;
|
||||
/* Quoting "nothing" is a bad thing */
|
||||
if (!*m)
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (!*m)
|
||||
{
|
||||
@@ -1765,9 +1765,9 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
|
||||
* match
|
||||
*/
|
||||
if (!*n)
|
||||
return TRUE;
|
||||
return true;
|
||||
if (just)
|
||||
return TRUE;
|
||||
return true;
|
||||
just = 0;
|
||||
goto not_matched;
|
||||
}
|
||||
@@ -1799,7 +1799,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
|
||||
* impossible to match it
|
||||
*/
|
||||
if (!*n)
|
||||
return FALSE;
|
||||
return false;
|
||||
if (mp)
|
||||
{
|
||||
m = mp;
|
||||
@@ -1821,7 +1821,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
|
||||
count = acount;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -193,11 +193,11 @@ wxColourDatabase::wxColourDatabase (int type) : wxList (type)
|
||||
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;
|
||||
}
|
||||
@@ -330,16 +330,16 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour)
|
||||
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__
|
||||
@@ -411,9 +411,9 @@ wxString wxColourDatabase::FindName (const wxColour& colour) const
|
||||
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)
|
||||
{
|
||||
@@ -588,11 +588,11 @@ wxBitmapList::wxBitmapList()
|
||||
|
||||
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;
|
||||
@@ -602,11 +602,11 @@ wxBitmapList::~wxBitmapList ()
|
||||
// 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;
|
||||
@@ -625,9 +625,9 @@ void wxPenList::RemovePen (wxPen * pen)
|
||||
|
||||
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 &&
|
||||
@@ -657,11 +657,11 @@ wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, int style)
|
||||
|
||||
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;
|
||||
@@ -675,9 +675,9 @@ void wxBrushList::AddBrush (wxBrush * brush)
|
||||
|
||||
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 &&
|
||||
@@ -712,15 +712,15 @@ void wxBrushList::RemoveBrush (wxBrush * brush)
|
||||
|
||||
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;
|
||||
@@ -747,9 +747,9 @@ wxFont *wxFontList::FindOrCreateFont(int pointSize,
|
||||
{
|
||||
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 &&
|
||||
@@ -844,12 +844,12 @@ wxSize wxGetDisplaySizeMM()
|
||||
|
||||
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 ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -493,7 +493,7 @@ wxObject *wxHashTable::Get (long key, long value) const
|
||||
{
|
||||
wxNode *node = hash_table[position]->Find (value);
|
||||
if (node)
|
||||
return node->Data ();
|
||||
return node->GetData ();
|
||||
else
|
||||
return (wxObject *) NULL;
|
||||
}
|
||||
@@ -513,7 +513,7 @@ wxObject *wxHashTable::Get (long key, const wxChar *value) const
|
||||
{
|
||||
wxNode *node = hash_table[position]->Find (value);
|
||||
if (node)
|
||||
return node->Data ();
|
||||
return node->GetData ();
|
||||
else
|
||||
return (wxObject *) NULL;
|
||||
}
|
||||
@@ -532,7 +532,7 @@ wxObject *wxHashTable::Get (long key) const
|
||||
else
|
||||
{
|
||||
wxNode *node = hash_table[position]->Find (k);
|
||||
return node ? node->Data () : (wxObject*)NULL;
|
||||
return node ? node->GetData () : (wxObject*)NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -546,7 +546,7 @@ wxObject *wxHashTable::Get (const wxChar *key) const
|
||||
else
|
||||
{
|
||||
wxNode *node = hash_table[position]->Find (key);
|
||||
return node ? node->Data () : (wxObject*)NULL;
|
||||
return node ? node->GetData () : (wxObject*)NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -565,7 +565,7 @@ wxObject *wxHashTable::Delete (long key)
|
||||
wxNode *node = hash_table[position]->Find (k);
|
||||
if (node)
|
||||
{
|
||||
wxObject *data = node->Data ();
|
||||
wxObject *data = node->GetData ();
|
||||
delete node;
|
||||
m_count--;
|
||||
return data;
|
||||
@@ -587,7 +587,7 @@ wxObject *wxHashTable::Delete (const wxChar *key)
|
||||
wxNode *node = hash_table[position]->Find (key);
|
||||
if (node)
|
||||
{
|
||||
wxObject *data = node->Data ();
|
||||
wxObject *data = node->GetData ();
|
||||
delete node;
|
||||
m_count--;
|
||||
return data;
|
||||
@@ -612,7 +612,7 @@ wxObject *wxHashTable::Delete (long key, int value)
|
||||
wxNode *node = hash_table[position]->Find (value);
|
||||
if (node)
|
||||
{
|
||||
wxObject *data = node->Data ();
|
||||
wxObject *data = node->GetData ();
|
||||
delete node;
|
||||
m_count--;
|
||||
return data;
|
||||
@@ -634,7 +634,7 @@ wxObject *wxHashTable::Delete (long key, const wxChar *value)
|
||||
wxNode *node = hash_table[position]->Find (value);
|
||||
if (node)
|
||||
{
|
||||
wxObject *data = node->Data ();
|
||||
wxObject *data = node->GetData ();
|
||||
delete node;
|
||||
m_count--;
|
||||
return data;
|
||||
@@ -679,14 +679,14 @@ wxNode *wxHashTable::Next ()
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -58,13 +58,13 @@ wxHTTP::~wxHTTP()
|
||||
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();
|
||||
@@ -92,7 +92,7 @@ void wxHTTP::SetHeader(const wxString& header, const wxString& h_data)
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -108,16 +108,16 @@ wxString wxHTTP::GetHeader(const wxString& header)
|
||||
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());
|
||||
@@ -125,7 +125,7 @@ void wxHTTP::SendHeaders()
|
||||
const wxWX2MBbuf cbuf = buf.mb_str();
|
||||
Write(cbuf, strlen(cbuf));
|
||||
|
||||
head = head->Next();
|
||||
head = head->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1213,51 +1213,51 @@ bool wxImage::RemoveHandler( const wxString& name )
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1271,11 +1271,11 @@ void wxImage::InitStandardHandlers()
|
||||
|
||||
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;
|
||||
|
@@ -513,9 +513,9 @@ void wxListBase::Sort(const wxSortCompareFunction compfunc)
|
||||
|
||||
// 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
|
||||
@@ -523,7 +523,7 @@ void wxListBase::Sort(const wxSortCompareFunction compfunc)
|
||||
|
||||
// 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++);
|
||||
}
|
||||
@@ -538,12 +538,35 @@ void wxListBase::Sort(const wxSortCompareFunction compfunc)
|
||||
|
||||
#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();
|
||||
@@ -590,6 +613,11 @@ void wxStringList::DoCopy(const wxStringList& other)
|
||||
}
|
||||
}
|
||||
|
||||
wxStringList::wxStringList()
|
||||
{
|
||||
DeleteContents(TRUE);
|
||||
}
|
||||
|
||||
// Variable argument list, terminated by a zero
|
||||
// Makes new storage for the strings
|
||||
wxStringList::wxStringList (const wxChar *first, ...)
|
||||
|
@@ -58,7 +58,7 @@ void wxModule::RegisterModules()
|
||||
node = wxClassInfo::sm_classTable->Next();
|
||||
while (node)
|
||||
{
|
||||
classInfo = (wxClassInfo *)node->Data();
|
||||
classInfo = (wxClassInfo *)node->GetData();
|
||||
if ( classInfo->IsKindOf(CLASSINFO(wxModule)) &&
|
||||
(classInfo != (& (wxModule::sm_classwxModule))) )
|
||||
{
|
||||
|
@@ -192,46 +192,46 @@ wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const wxString& name)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@@ -834,11 +834,11 @@ void wxSocketBase::RestoreState()
|
||||
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;
|
||||
|
@@ -431,10 +431,10 @@ wxWindow* wxFindWindowAtPoint(wxWindow* win, const wxPoint& pt)
|
||||
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;
|
||||
@@ -443,14 +443,14 @@ wxWindow* wxFindWindowAtPoint(wxWindow* win, const wxPoint& pt)
|
||||
}
|
||||
*/
|
||||
|
||||
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();
|
||||
@@ -472,14 +472,14 @@ wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt)
|
||||
// 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;
|
||||
}
|
||||
|
@@ -73,21 +73,21 @@ bool wxTextValidator::Copy(const wxTextValidator& val)
|
||||
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()
|
||||
@@ -100,9 +100,9 @@ static bool wxIsAlpha(const wxString& val)
|
||||
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)
|
||||
@@ -111,9 +111,9 @@ 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.
|
||||
@@ -121,17 +121,17 @@ static bool wxIsAlphaNumeric(const wxString& val)
|
||||
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;
|
||||
@@ -149,25 +149,25 @@ bool wxTextValidator::Validate(wxWindow *parent)
|
||||
}
|
||||
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.");
|
||||
}
|
||||
@@ -175,13 +175,13 @@ bool wxTextValidator::Validate(wxWindow *parent)
|
||||
{
|
||||
//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 )
|
||||
@@ -204,24 +204,24 @@ bool wxTextValidator::Validate(wxWindow *parent)
|
||||
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)
|
||||
@@ -233,12 +233,12 @@ 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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,12 +251,12 @@ void wxTextValidator::SetExcludeList(const wxStringList& list)
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ void wxTextValidator::OnChar(wxKeyEvent& event)
|
||||
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)) ||
|
||||
@@ -305,9 +305,9 @@ static bool wxIsNumeric(const wxString& val)
|
||||
// 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)
|
||||
@@ -316,9 +316,9 @@ 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)
|
||||
@@ -327,9 +327,9 @@ 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
|
||||
|
@@ -101,23 +101,23 @@ wxVariantDataList::~wxVariantDataList()
|
||||
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();
|
||||
}
|
||||
@@ -129,12 +129,12 @@ void wxVariantDataList::Copy(wxVariantData& data)
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,19 +143,19 @@ bool wxVariantDataList::Eq(wxVariantData& data) const
|
||||
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
|
||||
@@ -164,25 +164,25 @@ bool wxVariantDataList::Write(wxSTD ostream& str) const
|
||||
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
|
||||
@@ -190,7 +190,7 @@ bool wxVariantDataList::Read(wxSTD istream& WXUNUSED(str))
|
||||
{
|
||||
wxFAIL_MSG(wxT("Unimplemented"));
|
||||
// TODO
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -198,7 +198,7 @@ bool wxVariantDataList::Read(wxString& WXUNUSED(str))
|
||||
{
|
||||
wxFAIL_MSG(wxT("Unimplemented"));
|
||||
// TODO
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -252,19 +252,19 @@ bool wxVariantDataStringList::Eq(wxVariantData& data) const
|
||||
wxASSERT_MSG( (data.GetType() == wxT("stringlist")), wxT("wxVariantDataStringList::Eq: argument mismatch") );
|
||||
|
||||
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
|
||||
@@ -273,24 +273,24 @@ bool wxVariantDataStringList::Write(wxSTD ostream& str) const
|
||||
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
|
||||
@@ -298,7 +298,7 @@ bool wxVariantDataStringList::Read(wxSTD istream& WXUNUSED(str))
|
||||
{
|
||||
wxFAIL_MSG(wxT("Unimplemented"));
|
||||
// TODO
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -306,7 +306,7 @@ bool wxVariantDataStringList::Read(wxString& WXUNUSED(str))
|
||||
{
|
||||
wxFAIL_MSG(wxT("Unimplemented"));
|
||||
// TODO
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -369,21 +369,21 @@ bool wxVariantDataLong::Write(wxSTD ostream& str) const
|
||||
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
|
||||
|
||||
@@ -393,21 +393,21 @@ bool wxVariantDataLong::Write(wxOutputStream& str) const
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -470,21 +470,21 @@ bool wxVariantDataReal::Write(wxSTD ostream& str) const
|
||||
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
|
||||
|
||||
@@ -493,21 +493,21 @@ bool wxVariantDataReal::Write(wxOutputStream& str) const
|
||||
{
|
||||
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
|
||||
@@ -571,14 +571,14 @@ bool wxVariantDataBool::Write(wxSTD ostream& str) const
|
||||
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
|
||||
@@ -586,7 +586,7 @@ bool wxVariantDataBool::Read(wxSTD istream& WXUNUSED(str))
|
||||
{
|
||||
wxFAIL_MSG(wxT("Unimplemented"));
|
||||
// str >> (long) m_value;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -596,7 +596,7 @@ bool wxVariantDataBool::Write(wxOutputStream& str) const
|
||||
wxTextOutputStream s(str);
|
||||
|
||||
s.Write8(m_value);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxVariantDataBool::Read(wxInputStream& str)
|
||||
@@ -604,14 +604,14 @@ 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
|
||||
|
||||
@@ -673,14 +673,14 @@ bool wxVariantDataChar::Write(wxSTD ostream& str) const
|
||||
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
|
||||
@@ -688,7 +688,7 @@ bool wxVariantDataChar::Read(wxSTD istream& WXUNUSED(str))
|
||||
{
|
||||
wxFAIL_MSG(wxT("Unimplemented"));
|
||||
// str >> m_value;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -698,7 +698,7 @@ bool wxVariantDataChar::Write(wxOutputStream& str) const
|
||||
wxTextOutputStream s(str);
|
||||
|
||||
s.Write8(m_value);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxVariantDataChar::Read(wxInputStream& str)
|
||||
@@ -706,14 +706,14 @@ 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;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -781,21 +781,21 @@ bool wxVariantDataString::Eq(wxVariantData& data) const
|
||||
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
|
||||
|
||||
@@ -805,7 +805,7 @@ bool wxVariantDataString::Write(wxOutputStream& str) const
|
||||
// why doesn't wxOutputStream::operator<< take "const wxString&"
|
||||
wxTextOutputStream s(str);
|
||||
s.WriteString(m_value);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxVariantDataString::Read(wxInputStream& str)
|
||||
@@ -813,14 +813,14 @@ 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__)
|
||||
@@ -857,7 +857,7 @@ public:
|
||||
#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;
|
||||
@@ -889,7 +889,7 @@ bool wxVariantDataTime::Write(wxSTD ostream& str) const
|
||||
wxString s;
|
||||
Write(s);
|
||||
str << (const char*) s.mb_str();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -897,21 +897,21 @@ bool wxVariantDataTime::Write(wxString& str) const
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -939,7 +939,7 @@ public:
|
||||
#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;
|
||||
@@ -971,28 +971,28 @@ bool wxVariantDataDate::Write(wxSTD ostream& str) const
|
||||
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
|
||||
@@ -1022,7 +1022,7 @@ public:
|
||||
#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;
|
||||
@@ -1056,28 +1056,28 @@ bool wxVariantDataVoidPtr::Write(wxSTD ostream& str) const
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1148,7 +1148,7 @@ bool wxVariantDataDateTime::Eq(wxVariantData& data) const
|
||||
bool wxVariantDataDateTime::Write(wxSTD ostream& str) const
|
||||
{
|
||||
// Not implemented
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1156,7 +1156,7 @@ bool wxVariantDataDateTime::Write(wxSTD ostream& str) const
|
||||
bool wxVariantDataDateTime::Write(wxString& str) const
|
||||
{
|
||||
str = m_value.Format();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1164,7 +1164,7 @@ bool wxVariantDataDateTime::Write(wxString& str) const
|
||||
bool wxVariantDataDateTime::Read(wxSTD istream& WXUNUSED(str))
|
||||
{
|
||||
// Not implemented
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1172,8 +1172,8 @@ bool wxVariantDataDateTime::Read(wxSTD istream& WXUNUSED(str))
|
||||
bool wxVariantDataDateTime::Read(wxString& str)
|
||||
{
|
||||
if(! m_value.ParseDateTime(str))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -1234,7 +1234,7 @@ bool wxVariantDataArrayString::Eq(wxVariantData& data) const
|
||||
bool wxVariantDataArrayString::Write(wxSTD ostream& str) const
|
||||
{
|
||||
// Not implemented
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1250,7 +1250,7 @@ bool wxVariantDataArrayString::Write(wxString& str) const
|
||||
str += m_value[n];
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1258,7 +1258,7 @@ bool wxVariantDataArrayString::Write(wxString& str) const
|
||||
bool wxVariantDataArrayString::Read(wxSTD istream& WXUNUSED(str))
|
||||
{
|
||||
// Not implemented
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1271,7 +1271,7 @@ bool wxVariantDataArrayString::Read(wxString& str)
|
||||
m_value.Add(tk.GetNextToken());
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1472,7 +1472,7 @@ bool wxVariant::operator== (double value) const
|
||||
{
|
||||
double thisValue;
|
||||
if (!Convert(&thisValue))
|
||||
return FALSE;
|
||||
return false;
|
||||
else
|
||||
return (value == thisValue);
|
||||
}
|
||||
@@ -1500,7 +1500,7 @@ bool wxVariant::operator== (long value) const
|
||||
{
|
||||
long thisValue;
|
||||
if (!Convert(&thisValue))
|
||||
return FALSE;
|
||||
return false;
|
||||
else
|
||||
return (value == thisValue);
|
||||
}
|
||||
@@ -1528,7 +1528,7 @@ bool wxVariant::operator== (char value) const
|
||||
{
|
||||
char thisValue;
|
||||
if (!Convert(&thisValue))
|
||||
return FALSE;
|
||||
return false;
|
||||
else
|
||||
return (value == thisValue);
|
||||
}
|
||||
@@ -1557,7 +1557,7 @@ bool wxVariant::operator== (bool value) const
|
||||
{
|
||||
bool thisValue;
|
||||
if (!Convert(&thisValue))
|
||||
return FALSE;
|
||||
return false;
|
||||
else
|
||||
return (value == thisValue);
|
||||
}
|
||||
@@ -1586,7 +1586,7 @@ bool wxVariant::operator== (const wxString& value) const
|
||||
{
|
||||
wxString thisValue;
|
||||
if (!Convert(&thisValue))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return value == thisValue;
|
||||
}
|
||||
@@ -1684,7 +1684,7 @@ bool wxVariant::operator== (const wxTime& value) const
|
||||
{
|
||||
wxTime thisValue;
|
||||
if (!Convert(&thisValue))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return value == thisValue;
|
||||
}
|
||||
@@ -1712,7 +1712,7 @@ bool wxVariant::operator== (const wxDate& value) const
|
||||
{
|
||||
wxDate thisValue;
|
||||
if (!Convert(&thisValue))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return (value == thisValue);
|
||||
}
|
||||
@@ -1765,7 +1765,7 @@ bool wxVariant::operator== (const wxDateTime& value) const
|
||||
{
|
||||
wxDateTime thisValue;
|
||||
if (!Convert(&thisValue))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return value.IsEqualTo(thisValue);
|
||||
}
|
||||
@@ -1819,7 +1819,7 @@ bool wxVariant::operator==(const wxArrayString& WXUNUSED(value)) const
|
||||
{
|
||||
wxFAIL_MSG( _T("TODO") );
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxVariant::operator!=(const wxArrayString& value) const
|
||||
@@ -1857,15 +1857,15 @@ wxVariant wxVariant::operator[] (size_t idx) 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;
|
||||
@@ -1879,9 +1879,9 @@ wxVariant& wxVariant::operator[] (size_t idx)
|
||||
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
|
||||
@@ -1892,12 +1892,12 @@ int wxVariant::GetCount() const
|
||||
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;
|
||||
}
|
||||
@@ -2078,20 +2078,20 @@ void wxVariant::Insert(const wxVariant& value)
|
||||
list.Insert(new wxVariant(value));
|
||||
}
|
||||
|
||||
// Returns TRUE if the variant is a member of the list
|
||||
// Returns true if the variant is a member of the list
|
||||
bool wxVariant::Member(const wxVariant& value) const
|
||||
{
|
||||
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
|
||||
@@ -2099,12 +2099,12 @@ bool wxVariant::Delete(int item)
|
||||
{
|
||||
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
|
||||
@@ -2140,9 +2140,9 @@ bool wxVariant::Convert(long* value) const
|
||||
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
|
||||
@@ -2161,16 +2161,16 @@ 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
|
||||
@@ -2187,9 +2187,9 @@ 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
|
||||
@@ -2204,15 +2204,15 @@ 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
|
||||
@@ -2225,9 +2225,9 @@ bool wxVariant::Convert(wxTime* value) const
|
||||
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
|
||||
@@ -2236,9 +2236,9 @@ 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
|
||||
|
||||
@@ -2248,7 +2248,7 @@ bool wxVariant::Convert(wxDateTime* value) const
|
||||
if (type == wxT("datetime"))
|
||||
{
|
||||
*value = ((wxVariantDataDateTime*)GetData())->GetValue();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
// Fallback to string conversion
|
||||
wxString val;
|
||||
|
@@ -1549,13 +1549,13 @@ void wxPostScriptDC::DoDrawSpline( wxList *points )
|
||||
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;
|
||||
@@ -1571,9 +1571,9 @@ void wxPostScriptDC::DoDrawSpline( wxList *points )
|
||||
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;
|
||||
|
@@ -86,12 +86,12 @@ wxHTMLHelpControllerBase::DeleteList()
|
||||
{
|
||||
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;
|
||||
@@ -222,17 +222,17 @@ wxHTMLHelpControllerBase::DisplayContents()
|
||||
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;
|
||||
@@ -254,14 +254,14 @@ wxHTMLHelpControllerBase::DisplaySection(int sectionNo)
|
||||
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;
|
||||
}
|
||||
@@ -295,7 +295,7 @@ wxHTMLHelpControllerBase::KeywordSearch(const wxString& k)
|
||||
int idx = 0, j;
|
||||
bool rc;
|
||||
bool showAll = k.IsEmpty();
|
||||
wxNode *node = m_MapList->First();
|
||||
wxNode *node = m_MapList->GetFirst();
|
||||
wxExtHelpMapEntry *entry;
|
||||
|
||||
{
|
||||
@@ -303,7 +303,7 @@ wxHTMLHelpControllerBase::KeywordSearch(const wxString& k)
|
||||
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())
|
||||
{
|
||||
@@ -318,7 +318,7 @@ wxHTMLHelpControllerBase::KeywordSearch(const wxString& k)
|
||||
choices[idx] << entry->doc.c_str()[j];
|
||||
idx++;
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -48,7 +48,7 @@ wxGenericImageList::~wxGenericImageList()
|
||||
|
||||
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) )
|
||||
@@ -71,7 +71,7 @@ int wxGenericImageList::Add( const wxBitmap &bitmap )
|
||||
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 )
|
||||
@@ -91,16 +91,16 @@ int wxGenericImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour
|
||||
|
||||
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") );
|
||||
|
||||
@@ -116,14 +116,14 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
|
||||
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 );
|
||||
}
|
||||
@@ -133,7 +133,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
|
||||
|
||||
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") );
|
||||
|
||||
@@ -154,11 +154,11 @@ bool wxGenericImageList::GetSize( int index, int &width, int &height ) const
|
||||
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();
|
||||
|
||||
@@ -168,11 +168,11 @@ bool wxGenericImageList::GetSize( int index, int &width, int &height ) const
|
||||
bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y,
|
||||
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);
|
||||
|
@@ -195,10 +195,10 @@ bool wxLayoutAlgorithm::LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* r)
|
||||
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);
|
||||
@@ -206,7 +206,7 @@ bool wxLayoutAlgorithm::LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* r)
|
||||
|
||||
win->GetEventHandler()->ProcessEvent(event);
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
wxWindow* clientWindow = frame->GetClientWindow();
|
||||
@@ -263,11 +263,12 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
|
||||
|
||||
// Find the last layout-aware window, so we can make it fill all remaining
|
||||
// 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())
|
||||
{
|
||||
@@ -279,14 +280,14 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
|
||||
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.
|
||||
@@ -299,7 +300,7 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
|
||||
win->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
if (event.GetRect().GetWidth() < 0 || event.GetRect().GetHeight() < 0)
|
||||
@@ -307,10 +308,10 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
|
||||
|
||||
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.
|
||||
@@ -323,7 +324,7 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
|
||||
win->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
rect = event.GetRect();
|
||||
|
@@ -171,7 +171,7 @@ void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent))
|
||||
2, choices,
|
||||
1, wxRA_VERTICAL);
|
||||
m_rangeRadioBox->SetSelection(1);
|
||||
|
||||
|
||||
mainsizer->Add( m_rangeRadioBox, 0, wxLEFT|wxTOP|wxRIGHT, 10 );
|
||||
}
|
||||
|
||||
@@ -520,13 +520,13 @@ wxComboBox *wxGenericPrintSetupDialog::CreatePaperTypeChoice(int *x, int *y)
|
||||
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;
|
||||
@@ -534,10 +534,12 @@ wxComboBox *wxGenericPrintSetupDialog::CreatePaperTypeChoice(int *x, int *y)
|
||||
|
||||
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);
|
||||
|
||||
@@ -583,31 +585,41 @@ void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event))
|
||||
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);
|
||||
|
||||
@@ -778,22 +790,24 @@ wxComboBox *wxGenericPageSetupDialog::CreatePaperTypeChoice(int *x, int *y)
|
||||
}
|
||||
*/
|
||||
|
||||
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;
|
||||
|
||||
|
@@ -159,12 +159,12 @@ wxPropertyValue::wxPropertyValue(wxList *the_list)
|
||||
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;
|
||||
@@ -178,12 +178,12 @@ wxPropertyValue::wxPropertyValue(wxStringList *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;
|
||||
}
|
||||
@@ -939,14 +939,14 @@ wxPropertyValidator *wxPropertyView::FindPropertyValidator(wxProperty *property)
|
||||
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;
|
||||
/*
|
||||
@@ -989,7 +989,7 @@ wxProperty *wxPropertySheet::GetProperty(const wxString& name) const
|
||||
if (!node)
|
||||
return NULL;
|
||||
else
|
||||
return (wxProperty *)node->Data();
|
||||
return (wxProperty *)node->GetData();
|
||||
}
|
||||
|
||||
bool wxPropertySheet::SetProperty(const wxString& name, const wxPropertyValue& value)
|
||||
@@ -1008,7 +1008,7 @@ void wxPropertySheet::RemoveProperty(const wxString& name)
|
||||
wxNode *node = m_properties.Find(name);
|
||||
if(node)
|
||||
{
|
||||
wxProperty *prop = (wxProperty *)node->Data();
|
||||
wxProperty *prop = (wxProperty *)node->GetData();
|
||||
delete prop;
|
||||
m_properties.DeleteNode(node);
|
||||
}
|
||||
@@ -1022,11 +1022,11 @@ bool wxPropertySheet::HasProperty(const wxString& name) const
|
||||
// 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;
|
||||
@@ -1036,12 +1036,12 @@ void wxPropertySheet::Clear(void)
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1077,7 +1077,7 @@ void wxPropertyValidatorRegistry::ClearRegistry(void)
|
||||
wxNode *node;
|
||||
while ((node = Next()) != NULL)
|
||||
{
|
||||
delete (wxPropertyValidator *)node->Data();
|
||||
delete (wxPropertyValidator *)node->GetData();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -87,10 +87,10 @@ bool wxPropertyFormView::Check(void)
|
||||
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)))
|
||||
{
|
||||
@@ -98,7 +98,7 @@ bool wxPropertyFormView::Check(void)
|
||||
if (!formValidator->OnCheckValue(prop, this, m_propertyWindow))
|
||||
return FALSE;
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -108,17 +108,17 @@ bool wxPropertyFormView::TransferToPropertySheet(void)
|
||||
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;
|
||||
}
|
||||
@@ -128,17 +128,17 @@ bool wxPropertyFormView::TransferToDialog(void)
|
||||
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;
|
||||
}
|
||||
@@ -148,17 +148,17 @@ bool wxPropertyFormView::AssociateNames(void)
|
||||
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;
|
||||
}
|
||||
@@ -229,10 +229,10 @@ void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event)
|
||||
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);
|
||||
@@ -243,7 +243,7 @@ void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event)
|
||||
return;
|
||||
}
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -268,10 +268,10 @@ void wxPropertyFormView::OnDoubleClick(wxControl *item)
|
||||
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);
|
||||
@@ -282,7 +282,7 @@ void wxPropertyFormView::OnDoubleClick(wxControl *item)
|
||||
return;
|
||||
}
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,12 +716,12 @@ bool wxStringFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormV
|
||||
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());
|
||||
@@ -740,12 +740,12 @@ bool wxStringFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormV
|
||||
{
|
||||
// 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());
|
||||
|
@@ -151,16 +151,16 @@ bool wxPropertyListView::UpdatePropertyList(bool clearEditArea)
|
||||
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;
|
||||
}
|
||||
@@ -1196,18 +1196,20 @@ bool wxStringListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wx
|
||||
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);
|
||||
@@ -1233,32 +1235,34 @@ bool wxStringListValidator::OnClearDetailControls(wxProperty *WXUNUSED(property)
|
||||
|
||||
// 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;
|
||||
}
|
||||
@@ -1521,7 +1525,9 @@ bool wxListOfStringsListValidator::OnDoubleClick(wxProperty *property, wxPropert
|
||||
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;
|
||||
@@ -1542,13 +1548,13 @@ void wxListOfStringsListValidator::OnEdit(wxProperty *property, wxPropertyListVi
|
||||
{
|
||||
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);
|
||||
@@ -1698,13 +1704,13 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList
|
||||
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);
|
||||
@@ -1745,7 +1751,7 @@ void wxPropertyStringListEditorDialog::OnDelete(wxCommandEvent& WXUNUSED(event))
|
||||
return;
|
||||
|
||||
m_listBox->Delete(sel);
|
||||
delete[] (wxChar *)node->Data();
|
||||
delete[] (wxChar *)node->GetData();
|
||||
delete node;
|
||||
m_currentSelection = -1;
|
||||
m_stringText->SetValue(_T(""));
|
||||
@@ -1758,7 +1764,7 @@ void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event))
|
||||
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();
|
||||
@@ -1806,11 +1812,11 @@ void wxPropertyStringListEditorDialog::SaveCurrentSelection()
|
||||
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()
|
||||
@@ -1821,7 +1827,7 @@ 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);
|
||||
}
|
||||
|
@@ -617,9 +617,9 @@ void wxSashWindow::SizeWindows()
|
||||
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;
|
||||
@@ -658,7 +658,7 @@ void wxSashWindow::SizeWindows()
|
||||
|
||||
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
|
||||
|
@@ -140,7 +140,7 @@ void wxTreeLayout::CalcLayout(long nodeId, int level, wxDC& dc)
|
||||
{
|
||||
wxList children;
|
||||
GetChildren(nodeId, children);
|
||||
int n = children.Number();
|
||||
int n = children.GetCount();
|
||||
|
||||
if (m_orientation == FALSE)
|
||||
{
|
||||
@@ -158,11 +158,11 @@ void wxTreeLayout::CalcLayout(long nodeId, int level, wxDC& dc)
|
||||
SetNodeX(nodeId, (long)(GetNodeX(parentId) + m_xSpacing + x));
|
||||
}
|
||||
|
||||
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
|
||||
@@ -172,11 +172,11 @@ void wxTreeLayout::CalcLayout(long nodeId, int level, wxDC& dc)
|
||||
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);
|
||||
@@ -207,11 +207,11 @@ void wxTreeLayout::CalcLayout(long nodeId, int level, wxDC& dc)
|
||||
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
|
||||
@@ -221,11 +221,11 @@ void wxTreeLayout::CalcLayout(long nodeId, int level, wxDC& dc)
|
||||
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);
|
||||
|
@@ -237,7 +237,7 @@ static gint wxapp_idle_callback( gpointer WXUNUSED(data) )
|
||||
// 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();
|
||||
}
|
||||
@@ -607,13 +607,13 @@ bool wxApp::CallInternalIdle( wxWindow* win )
|
||||
{
|
||||
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;
|
||||
@@ -631,14 +631,14 @@ bool wxApp::SendIdleEvents( wxWindow* win )
|
||||
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;
|
||||
@@ -673,17 +673,17 @@ void wxApp::Dispatch()
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -143,7 +143,7 @@ void wxChoice::DoSetItemClientData( int n, void* 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::DoSetItemClientData") );
|
||||
|
||||
node->SetData( (wxObject*) clientData );
|
||||
@@ -153,17 +153,17 @@ void* wxChoice::DoGetItemClientData( int n ) const
|
||||
{
|
||||
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
|
||||
@@ -175,11 +175,11 @@ wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
{
|
||||
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()
|
||||
@@ -195,11 +195,11 @@ 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();
|
||||
|
@@ -160,7 +160,7 @@ void wxColour::InitFromName( const wxString &colourName )
|
||||
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 );
|
||||
}
|
||||
|
@@ -197,12 +197,12 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
||||
|
||||
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();
|
||||
|
||||
@@ -272,7 +272,7 @@ void wxComboBox::SetClientData( int n, void* clientData )
|
||||
{
|
||||
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 );
|
||||
@@ -282,20 +282,20 @@ void* wxComboBox::GetClientData( int n )
|
||||
{
|
||||
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 );
|
||||
@@ -305,10 +305,10 @@ wxClientData* wxComboBox::GetClientObject( int n )
|
||||
{
|
||||
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()
|
||||
@@ -318,12 +318,12 @@ 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();
|
||||
|
||||
@@ -348,15 +348,15 @@ void wxComboBox::Delete( int n )
|
||||
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 );
|
||||
|
@@ -447,7 +447,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
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
|
||||
@@ -470,7 +470,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
}
|
||||
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 );
|
||||
@@ -496,7 +496,7 @@ int wxListBox::DoAppend( const wxString& item )
|
||||
{
|
||||
GtkAddItem( item, index );
|
||||
|
||||
wxNode *node = m_clientList.Nth( index );
|
||||
wxNode *node = m_clientList.Item( index );
|
||||
m_clientList.Insert( node, (wxObject *)NULL );
|
||||
|
||||
return index;
|
||||
@@ -618,11 +618,11 @@ void wxListBox::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();
|
||||
@@ -643,12 +643,12 @@ void wxListBox::Delete( int n )
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -667,7 +667,7 @@ void wxListBox::DoSetItemClientData( int n, void* 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::DoSetItemClientData") );
|
||||
|
||||
node->SetData( (wxObject*) clientData );
|
||||
@@ -677,17 +677,17 @@ void* wxListBox::DoGetItemClientData( int n ) const
|
||||
{
|
||||
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
|
||||
@@ -699,11 +699,11 @@ wxClientData* wxListBox::DoGetItemClientObject( int n ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -62,7 +62,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
||||
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 );
|
||||
}
|
||||
@@ -75,22 +75,25 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
||||
|
||||
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 );
|
||||
}
|
||||
@@ -103,7 +106,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame,wxFrame)
|
||||
|
||||
void wxMDIParentFrame::Init()
|
||||
{
|
||||
m_justInserted = FALSE;
|
||||
m_justInserted = false;
|
||||
m_clientWindow = (wxMDIClientWindow *) NULL;
|
||||
}
|
||||
|
||||
@@ -123,7 +126,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
|
||||
|
||||
OnCreateClient();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
|
||||
@@ -158,20 +161,20 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget);
|
||||
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;
|
||||
@@ -179,7 +182,7 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
{
|
||||
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;
|
||||
@@ -188,11 +191,11 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
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 );
|
||||
}
|
||||
@@ -200,7 +203,7 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
}
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
/* show/hide parent menu bar as required */
|
||||
@@ -209,12 +212,12 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
{
|
||||
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;
|
||||
@@ -244,13 +247,16 @@ wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
|
||||
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;
|
||||
@@ -445,7 +451,7 @@ static void wxInsertChildInMDI( wxMDIClientWindow* parent, wxMDIChildFrame* chil
|
||||
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;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -469,7 +475,7 @@ wxMDIClientWindow::~wxMDIClientWindow()
|
||||
|
||||
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||
{
|
||||
m_needParent = TRUE;
|
||||
m_needParent = true;
|
||||
|
||||
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
|
||||
|
||||
@@ -477,7 +483,7 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") ))
|
||||
{
|
||||
wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_widget = gtk_notebook_new();
|
||||
@@ -491,9 +497,9 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||
|
||||
PostCreation();
|
||||
|
||||
Show( TRUE );
|
||||
Show( true );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -1323,13 +1323,13 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
|
||||
|
||||
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;
|
||||
|
@@ -91,20 +91,20 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_
|
||||
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 );
|
||||
|
||||
@@ -260,12 +260,12 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,10 +314,10 @@ wxSize wxRadioBox::LayoutItems()
|
||||
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;
|
||||
@@ -330,20 +330,20 @@ wxSize wxRadioBox::LayoutItems()
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -359,10 +359,10 @@ wxSize wxRadioBox::LayoutItems()
|
||||
{
|
||||
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;
|
||||
@@ -372,18 +372,18 @@ wxSize wxRadioBox::LayoutItems()
|
||||
|
||||
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;
|
||||
@@ -405,14 +405,14 @@ bool wxRadioBox::Show( bool show )
|
||||
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;
|
||||
@@ -424,10 +424,10 @@ int wxRadioBox::FindString( const wxString &find ) const
|
||||
|
||||
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
|
||||
@@ -438,7 +438,7 @@ int wxRadioBox::FindString( const wxString &find ) const
|
||||
|
||||
count++;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -450,16 +450,16 @@ void wxRadioBox::SetFocus()
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,11 +467,11 @@ void wxRadioBox::SetSelection( int n )
|
||||
{
|
||||
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();
|
||||
|
||||
@@ -486,13 +486,13 @@ int wxRadioBox::GetSelection(void) const
|
||||
|
||||
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") );
|
||||
@@ -504,11 +504,11 @@ wxString wxRadioBox::GetString( int n ) const
|
||||
{
|
||||
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) ) );
|
||||
@@ -532,11 +532,11 @@ void wxRadioBox::SetString( int item, const wxString& 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 ) );
|
||||
}
|
||||
@@ -546,15 +546,15 @@ bool wxRadioBox::Enable( bool enable )
|
||||
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;
|
||||
@@ -564,11 +564,11 @@ void wxRadioBox::Enable( int item, bool 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") );
|
||||
|
||||
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 );
|
||||
@@ -579,11 +579,11 @@ void wxRadioBox::Show( int item, bool show )
|
||||
{
|
||||
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 );
|
||||
@@ -595,13 +595,13 @@ wxString wxRadioBox::GetStringSelection() const
|
||||
{
|
||||
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) ) );
|
||||
@@ -610,7 +610,7 @@ wxString wxRadioBox::GetStringSelection() const
|
||||
#endif
|
||||
return str;
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
wxFAIL_MSG( wxT("wxRadioBox none selected") );
|
||||
@@ -630,7 +630,7 @@ bool wxRadioBox::SetStringSelection( const wxString &s )
|
||||
|
||||
int wxRadioBox::GetCount() const
|
||||
{
|
||||
return m_boxes.Number();
|
||||
return m_boxes.GetCount();
|
||||
}
|
||||
|
||||
int wxRadioBox::GetNumberOfRowsOrCols() const
|
||||
@@ -645,25 +645,25 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -673,27 +673,27 @@ void wxRadioBox::ApplyWidgetStyle()
|
||||
|
||||
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
|
||||
@@ -702,14 +702,14 @@ bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
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;
|
||||
|
@@ -1511,12 +1511,12 @@ wxWindowGTK *FindWindowForMouseEvent(wxWindowGTK *win, wxCoord& x, wxCoord& y)
|
||||
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;
|
||||
|
||||
|
@@ -237,7 +237,7 @@ static gint wxapp_idle_callback( gpointer WXUNUSED(data) )
|
||||
// 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();
|
||||
}
|
||||
@@ -607,13 +607,13 @@ bool wxApp::CallInternalIdle( wxWindow* win )
|
||||
{
|
||||
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;
|
||||
@@ -631,14 +631,14 @@ bool wxApp::SendIdleEvents( wxWindow* win )
|
||||
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;
|
||||
@@ -673,17 +673,17 @@ void wxApp::Dispatch()
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -143,7 +143,7 @@ void wxChoice::DoSetItemClientData( int n, void* 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::DoSetItemClientData") );
|
||||
|
||||
node->SetData( (wxObject*) clientData );
|
||||
@@ -153,17 +153,17 @@ void* wxChoice::DoGetItemClientData( int n ) const
|
||||
{
|
||||
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
|
||||
@@ -175,11 +175,11 @@ wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
{
|
||||
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()
|
||||
@@ -195,11 +195,11 @@ 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();
|
||||
|
@@ -160,7 +160,7 @@ void wxColour::InitFromName( const wxString &colourName )
|
||||
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 );
|
||||
}
|
||||
|
@@ -197,12 +197,12 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
||||
|
||||
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();
|
||||
|
||||
@@ -272,7 +272,7 @@ void wxComboBox::SetClientData( int n, void* clientData )
|
||||
{
|
||||
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 );
|
||||
@@ -282,20 +282,20 @@ void* wxComboBox::GetClientData( int n )
|
||||
{
|
||||
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 );
|
||||
@@ -305,10 +305,10 @@ wxClientData* wxComboBox::GetClientObject( int n )
|
||||
{
|
||||
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()
|
||||
@@ -318,12 +318,12 @@ 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();
|
||||
|
||||
@@ -348,15 +348,15 @@ void wxComboBox::Delete( int n )
|
||||
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 );
|
||||
|
@@ -447,7 +447,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
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
|
||||
@@ -470,7 +470,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
}
|
||||
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 );
|
||||
@@ -496,7 +496,7 @@ int wxListBox::DoAppend( const wxString& item )
|
||||
{
|
||||
GtkAddItem( item, index );
|
||||
|
||||
wxNode *node = m_clientList.Nth( index );
|
||||
wxNode *node = m_clientList.Item( index );
|
||||
m_clientList.Insert( node, (wxObject *)NULL );
|
||||
|
||||
return index;
|
||||
@@ -618,11 +618,11 @@ void wxListBox::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();
|
||||
@@ -643,12 +643,12 @@ void wxListBox::Delete( int n )
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -667,7 +667,7 @@ void wxListBox::DoSetItemClientData( int n, void* 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::DoSetItemClientData") );
|
||||
|
||||
node->SetData( (wxObject*) clientData );
|
||||
@@ -677,17 +677,17 @@ void* wxListBox::DoGetItemClientData( int n ) const
|
||||
{
|
||||
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
|
||||
@@ -699,11 +699,11 @@ wxClientData* wxListBox::DoGetItemClientObject( int n ) const
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -62,7 +62,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
||||
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 );
|
||||
}
|
||||
@@ -75,22 +75,25 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
||||
|
||||
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 );
|
||||
}
|
||||
@@ -103,7 +106,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame,wxFrame)
|
||||
|
||||
void wxMDIParentFrame::Init()
|
||||
{
|
||||
m_justInserted = FALSE;
|
||||
m_justInserted = false;
|
||||
m_clientWindow = (wxMDIClientWindow *) NULL;
|
||||
}
|
||||
|
||||
@@ -123,7 +126,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
|
||||
|
||||
OnCreateClient();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
|
||||
@@ -158,20 +161,20 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget);
|
||||
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;
|
||||
@@ -179,7 +182,7 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
{
|
||||
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;
|
||||
@@ -188,11 +191,11 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
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 );
|
||||
}
|
||||
@@ -200,7 +203,7 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
}
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
/* show/hide parent menu bar as required */
|
||||
@@ -209,12 +212,12 @@ void wxMDIParentFrame::OnInternalIdle()
|
||||
{
|
||||
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;
|
||||
@@ -244,13 +247,16 @@ wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
|
||||
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;
|
||||
@@ -445,7 +451,7 @@ static void wxInsertChildInMDI( wxMDIClientWindow* parent, wxMDIChildFrame* chil
|
||||
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;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -469,7 +475,7 @@ wxMDIClientWindow::~wxMDIClientWindow()
|
||||
|
||||
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||
{
|
||||
m_needParent = TRUE;
|
||||
m_needParent = true;
|
||||
|
||||
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
|
||||
|
||||
@@ -477,7 +483,7 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") ))
|
||||
{
|
||||
wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_widget = gtk_notebook_new();
|
||||
@@ -491,9 +497,9 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||
|
||||
PostCreation();
|
||||
|
||||
Show( TRUE );
|
||||
Show( true );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -1323,13 +1323,13 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
|
||||
|
||||
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;
|
||||
|
@@ -91,20 +91,20 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_
|
||||
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 );
|
||||
|
||||
@@ -260,12 +260,12 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,10 +314,10 @@ wxSize wxRadioBox::LayoutItems()
|
||||
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;
|
||||
@@ -330,20 +330,20 @@ wxSize wxRadioBox::LayoutItems()
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -359,10 +359,10 @@ wxSize wxRadioBox::LayoutItems()
|
||||
{
|
||||
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;
|
||||
@@ -372,18 +372,18 @@ wxSize wxRadioBox::LayoutItems()
|
||||
|
||||
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;
|
||||
@@ -405,14 +405,14 @@ bool wxRadioBox::Show( bool show )
|
||||
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;
|
||||
@@ -424,10 +424,10 @@ int wxRadioBox::FindString( const wxString &find ) const
|
||||
|
||||
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
|
||||
@@ -438,7 +438,7 @@ int wxRadioBox::FindString( const wxString &find ) const
|
||||
|
||||
count++;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -450,16 +450,16 @@ void wxRadioBox::SetFocus()
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,11 +467,11 @@ void wxRadioBox::SetSelection( int n )
|
||||
{
|
||||
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();
|
||||
|
||||
@@ -486,13 +486,13 @@ int wxRadioBox::GetSelection(void) const
|
||||
|
||||
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") );
|
||||
@@ -504,11 +504,11 @@ wxString wxRadioBox::GetString( int n ) const
|
||||
{
|
||||
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) ) );
|
||||
@@ -532,11 +532,11 @@ void wxRadioBox::SetString( int item, const wxString& 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 ) );
|
||||
}
|
||||
@@ -546,15 +546,15 @@ bool wxRadioBox::Enable( bool enable )
|
||||
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;
|
||||
@@ -564,11 +564,11 @@ void wxRadioBox::Enable( int item, bool 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") );
|
||||
|
||||
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 );
|
||||
@@ -579,11 +579,11 @@ void wxRadioBox::Show( int item, bool show )
|
||||
{
|
||||
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 );
|
||||
@@ -595,13 +595,13 @@ wxString wxRadioBox::GetStringSelection() const
|
||||
{
|
||||
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) ) );
|
||||
@@ -610,7 +610,7 @@ wxString wxRadioBox::GetStringSelection() const
|
||||
#endif
|
||||
return str;
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
wxFAIL_MSG( wxT("wxRadioBox none selected") );
|
||||
@@ -630,7 +630,7 @@ bool wxRadioBox::SetStringSelection( const wxString &s )
|
||||
|
||||
int wxRadioBox::GetCount() const
|
||||
{
|
||||
return m_boxes.Number();
|
||||
return m_boxes.GetCount();
|
||||
}
|
||||
|
||||
int wxRadioBox::GetNumberOfRowsOrCols() const
|
||||
@@ -645,25 +645,25 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -673,27 +673,27 @@ void wxRadioBox::ApplyWidgetStyle()
|
||||
|
||||
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
|
||||
@@ -702,14 +702,14 @@ bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
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;
|
||||
|
@@ -1511,12 +1511,12 @@ wxWindowGTK *FindWindowForMouseEvent(wxWindowGTK *win, wxCoord& x, wxCoord& y)
|
||||
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;
|
||||
|
||||
|
Reference in New Issue
Block a user