Fix some wxMotif build warnings about deprecated methods.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18811 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon 2003-01-18 13:01:17 +00:00
parent 52c71b808f
commit fd304d989b
11 changed files with 63 additions and 46 deletions

View File

@ -94,7 +94,7 @@ protected:
// common part of all contructors
void Init();
int m_noStrings;
size_t m_noStrings;
WXWidget m_menuWidget;
WXWidget m_buttonWidget;
wxWidgetArray m_widgetArray;

View File

@ -18,7 +18,10 @@
#if wxUSE_CLIPBOARD
class wxDataObject;
#include "wx/list.h"
WX_DECLARE_LIST(wxDataObject, wxDataObjectList);
bool WXDLLEXPORT wxOpenClipboard();
bool WXDLLEXPORT wxClipboardOpen();
@ -71,7 +74,7 @@ public:
// implementation from now on
bool m_open;
wxList m_data;
wxDataObjectList m_data;
bool m_usePrimary;
private:

View File

@ -525,24 +525,24 @@ 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 ;
}
void wxApp::DeletePendingObjects()
{
wxNode *node = wxPendingDelete.First();
wxNode *node = wxPendingDelete.GetFirst();
while (node)
{
wxObject *obj = (wxObject *)node->Data();
wxObject *obj = node->GetData();
delete obj;
@ -551,7 +551,7 @@ void wxApp::DeletePendingObjects()
// Deleting one object may have deleted other pending
// objects, so start from beginning of list again.
node = wxPendingDelete.First();
node = wxPendingDelete.GetFirst();
}
}
@ -566,6 +566,9 @@ static char *fallbackResources[] = {
// Create an application context
bool wxApp::OnInitGui()
{
if( !wxAppBase::OnInitGui() )
return FALSE;
XtToolkitInitialize() ;
wxTheApp->m_appContext = (WXAppContext) XtCreateApplicationContext();
XtAppSetFallbackResources((XtAppContext) wxTheApp->m_appContext, fallbackResources);

View File

@ -119,10 +119,12 @@ void wxButton::SetDefault()
// Because it's very hard to find wxButton in the same row,
// correction is straighforward: we set resource for all wxButton
// in this parent (but not sub panels)
for (wxNode * node = parent->GetChildren().First (); node; node = node->Next ())
for (wxWindowList::Node * node = parent->GetChildren().GetFirst ();
node; node = node->GetNext ())
{
wxButton *item = (wxButton *) node->Data ();
if (item->IsKindOf(CLASSINFO(wxButton)))
wxWindow *win = node->GetData ();
wxButton *item = wxDynamicCast(win, wxButton);
if (item)
{
bool managed = XtIsManaged((Widget) item->GetMainWidget());
if (managed)

View File

@ -222,7 +222,7 @@ void wxChoice::Delete(int n)
void wxChoice::Clear()
{
m_stringList.Clear ();
int i;
size_t i;
for (i = 0; i < m_noStrings; i++)
{
XtRemoveCallback((Widget) m_widgetArray[i],
@ -286,7 +286,7 @@ void wxChoice::SetSelection(int n)
#if 0
Dimension selectionWidth, selectionHeight;
#endif
wxXmString text( (char*)node->Data() );
wxXmString text( node->GetData() );
// MBN: this seems silly, at best, and causes wxChoices to be clipped:
// will remove "soon"
#if 0
@ -369,7 +369,7 @@ void wxChoice::DoSetSize(int x, int y, int width, int height, int sizeFlags)
if (width > -1)
{
int i;
size_t i;
for (i = 0; i < m_noStrings; i++)
XtVaSetValues ((Widget) m_widgetArray[i],
XmNwidth, actualWidth,
@ -379,7 +379,7 @@ void wxChoice::DoSetSize(int x, int y, int width, int height, int sizeFlags)
}
if (height > -1)
{
int i;
size_t i;
for (i = 0; i < m_noStrings; i++)
XtVaSetValues ((Widget) m_widgetArray[i],
XmNheight, actualHeight,
@ -457,7 +457,7 @@ void wxChoice::ChangeBackgroundColour()
DoChangeBackgroundColour(m_formWidget, m_backgroundColour);
DoChangeBackgroundColour(m_buttonWidget, m_backgroundColour);
DoChangeBackgroundColour(m_menuWidget, m_backgroundColour);
int i;
size_t i;
for (i = 0; i < m_noStrings; i++)
DoChangeBackgroundColour(m_widgetArray[i], m_backgroundColour);
}
@ -467,7 +467,7 @@ void wxChoice::ChangeForegroundColour()
DoChangeForegroundColour(m_formWidget, m_foregroundColour);
DoChangeForegroundColour(m_buttonWidget, m_foregroundColour);
DoChangeForegroundColour(m_menuWidget, m_foregroundColour);
int i;
size_t i;
for (i = 0; i < m_noStrings; i++)
DoChangeForegroundColour(m_widgetArray[i], m_foregroundColour);
}

View File

@ -26,6 +26,9 @@
#include "wx/clipbrd.h"
#include "wx/dataobj.h"
#include "wx/listimpl.cpp"
WX_DEFINE_LIST(wxDataObjectList);
#ifdef __VMS__
#pragma message disable nosimpint
#endif
@ -253,12 +256,12 @@ wxClipboard::~wxClipboard()
void wxClipboard::Clear()
{
wxNode* node = m_data.First();
wxDataObjectList::Node* node = m_data.GetFirst();
while (node)
{
wxDataObject* data = (wxDataObject*) node->Data();
wxDataObject* data = node->GetData();
delete data;
node = node->Next();
node = node->GetNext();
}
m_data.Clear();
}

View File

@ -137,10 +137,10 @@ int wxComboBox::DoAppend(const wxString& item)
void wxComboBox::Delete(int n)
{
XmComboBoxDeletePos((Widget) m_mainWidget, n+1);
wxNode *node = m_stringList.Nth(n);
wxStringList::Node *node = m_stringList.Item(n);
if (node)
{
delete[] (char *)node->Data();
delete[] node->GetData();
delete node;
}
m_clientDataDict.Delete(n, HasClientObjectData());
@ -173,9 +173,9 @@ int wxComboBox::GetSelection (void) const
wxString wxComboBox::GetString(int n) const
{
wxNode *node = m_stringList.Nth(n);
wxStringList::Node *node = m_stringList.Item(n);
if (node)
return wxString((char *) node->Data ());
return wxString(node->GetData ());
else
return wxEmptyString;
}

View File

@ -44,14 +44,14 @@ wxCursorRefData::wxCursorRefData()
wxCursorRefData::~wxCursorRefData()
{
wxNode* node = m_cursors.First();
wxList::Node* node = m_cursors.GetFirst();
while (node)
{
wxXCursor* c = (wxXCursor*) node->Data();
wxXCursor* c = (wxXCursor*) node->GetData();
// TODO: how to delete cursor?
// XDestroyCursor((Display*) c->m_display, (Cursor) c->m_cursor); // ??
delete c;
node = node->Next();
node = node->GetNext();
}
}
@ -402,13 +402,13 @@ WXCursor wxCursor::GetXCursor(WXDisplay* display)
{
if (!M_CURSORDATA)
return (WXCursor) 0;
wxNode* node = M_CURSORDATA->m_cursors.First();
wxList::Node* node = M_CURSORDATA->m_cursors.GetFirst();
while (node)
{
wxXCursor* c = (wxXCursor*) node->Data();
wxXCursor* c = (wxXCursor*) node->GetData();
if (c->m_display == display)
return c->m_cursor;
node = node->Next();
node = node->GetNext();
}
// No cursor for this display, so let's see if we're an id-type cursor.
@ -657,9 +657,10 @@ wxXSetBusyCursor (wxWindow * win, wxCursor * cursor)
XFlush (display);
for(wxNode *node = win->GetChildren().First (); node; node = node->Next())
for(wxWindowList::Node *node = win->GetChildren().GetFirst (); node;
node = node->GetNext())
{
wxWindow *child = (wxWindow *) node->Data ();
wxWindow *child = node->GetData ();
wxXSetBusyCursor (child, cursor);
}
}
@ -670,9 +671,10 @@ void wxBeginBusyCursor(wxCursor *cursor)
wxBusyCursorCount++;
if (wxBusyCursorCount == 1)
{
for(wxNode *node = wxTopLevelWindows.First (); node; node = node->Next())
for(wxWindowList::Node *node = wxTopLevelWindows.GetFirst (); node;
node = node->GetNext())
{
wxWindow *win = (wxWindow *) node->Data ();
wxWindow *win = node->GetData ();
wxXSetBusyCursor (win, cursor);
}
}
@ -687,9 +689,10 @@ void wxEndBusyCursor()
wxBusyCursorCount--;
if (wxBusyCursorCount == 0)
{
for(wxNode *node = wxTopLevelWindows.First (); node; node = node->Next())
for(wxWindowList::Node *node = wxTopLevelWindows.GetFirst (); node;
node = node->GetNext())
{
wxWindow *win = (wxWindow *) node->Data ();
wxWindow *win = node->GetData ();
wxXSetBusyCursor (win, NULL);
}
}

View File

@ -177,12 +177,12 @@ void wxFontRefData::Init(int pointSize,
wxFontRefData::~wxFontRefData()
{
wxNode* node = m_fonts.First();
wxList::Node* node = m_fonts.GetFirst();
while (node)
{
wxXFont* f = (wxXFont*) node->Data();
wxXFont* f = (wxXFont*) node->GetData();
delete f;
node = node->Next();
node = node->GetNext();
}
m_fonts.Clear();
}
@ -500,13 +500,13 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const
int pointSize = (M_FONTDATA->m_pointSize * 10 * intScale) / 100;
// search existing fonts first
wxNode* node = M_FONTDATA->m_fonts.First();
wxList::Node* node = M_FONTDATA->m_fonts.GetFirst();
while (node)
{
wxXFont* f = (wxXFont*) node->Data();
wxXFont* f = (wxXFont*) node->GetData();
if ((!display || (f->m_display == display)) && (f->m_scale == intScale))
return f;
node = node->Next();
node = node->GetNext();
}
// not found, create a new one

View File

@ -591,10 +591,11 @@ void wxFrame::OnActivate(wxActivateEvent& event)
if (!event.GetActive())
return;
for(wxNode *node = GetChildren().First(); node; node = node->Next())
for(wxWindowList::Node *node = GetChildren().GetFirst(); node;
node = node->GetNext())
{
// Find a child that's a subwindow, but not a dialog box.
wxWindow *child = (wxWindow *)node->Data();
wxWindow *child = node->GetData();
if (!child->IsTopLevel())
{
child->SetFocus();

View File

@ -81,7 +81,9 @@
#define DEFAULT_XRESOURCE_DIR "/usr/lib/X11/app-defaults"
#endif
#if wxUSE_RESOURCES
static char *GetIniFile (char *dest, const char *filename);
#endif
// ============================================================================
// implementation
@ -226,6 +228,8 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn)
// Reading and writing resources (eg WIN.INI, .Xdefaults)
// ----------------------------------------------------------------------------
#if wxUSE_RESOURCES
// Read $HOME for what it says is home, if not
// read $USER or $LOGNAME for user name else determine
// the Real User, then determine the Real home dir.
@ -256,8 +260,6 @@ static char * GetIniFile (char *dest, const char *filename)
return dest;
}
#if wxUSE_RESOURCES
static char *GetResourcePath(char *buf, const char *name, bool create = FALSE)
{
if (create && wxFileExists (name) ) {