]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix some wxMotif build warnings about deprecated methods.
authorMattia Barbon <mbarbon@cpan.org>
Sat, 18 Jan 2003 13:01:17 +0000 (13:01 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Sat, 18 Jan 2003 13:01:17 +0000 (13:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18811 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/motif/choice.h
include/wx/motif/clipbrd.h
src/motif/app.cpp
src/motif/button.cpp
src/motif/choice.cpp
src/motif/clipbrd.cpp
src/motif/combobox.cpp
src/motif/cursor.cpp
src/motif/font.cpp
src/motif/frame.cpp
src/motif/utils.cpp

index 070f5191e930321ceb70b59384828f70bce3b736..a2d019541823db6cab2923b5fcbe91075b5d321d 100644 (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;
index 848bfe65655800377b0aee28b9964a3670d979d2..6b17de1e9f5af18121adb3eb932682db3281f1c2 100644 (file)
 
 #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:
index 34fdebf6809238943122f1f9acb4bb128fb71899..3cfc2853e2fe932f9e103cdd76fceac10b79e5bf 100644 (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);
index 645f99cf44330589c2fa0f89e238593ff4fcd07f..de02890cb2b3b5d4e9220244a4a7a2a4bc706315 100644 (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)
index bfe6a69b47c527efb9faffb9f023daa53a0f9496..a3e57838b93bf6864f2f11ef45d9533fec9fe962 100644 (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);
 }
index 0ee8acb95865c7703b4da6bc9ab082164d6aef0e..9bd9307194685a5016172fe5e1324437e83dd04b 100644 (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();
 }
index 72d2836507affec3d6037cfcfa1b906066af3a31..36e322073f2c621e40ec0622533fa35e6f5adf14 100644 (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;
 }
index 9709ba21f822af2305e76de81ef8992308a59944..7e7fa61066e5e4276ffad20ce4be04c22a57bc8a 100644 (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);
         }
     }
index e63de3bf42faada65180b07736a508a9488f7ad1..c6e1b6dd2cb4c259993e2f8ae510c965d6f1f392 100644 (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
index 3e3b6605d98474f259355f4c6a355f13dfc2b53a..becd7bf078a4923e597a5cf616751630447f40ce 100644 (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();
index 179a3a43d630eed436a7752b6f847014070af82c..36df02e7fc084ab6badd0d91790501298a062f63 100644 (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) ) {