]> git.saurik.com Git - wxWidgets.git/commitdiff
Line-up interfaces to use size_t for GetCount()s (and count related api).
authorWłodzimierz Skiba <abx@abx.art.pl>
Sun, 12 Mar 2006 14:49:25 +0000 (14:49 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Sun, 12 Mar 2006 14:49:25 +0000 (14:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/activexevt.tex
docs/latex/wx/variant.tex
include/wx/msw/ole/activex.h
include/wx/variant.h
src/common/variant.cpp

index 301b8659851e7be786ab67b923df80543e625d08..70cd378ccdb6f8a07cef6fadb19092c3885e7c59 100644 (file)
@@ -40,28 +40,28 @@ recieves an activex event.}
 
 \membersection{wxActiveXEvent::ParamCount}\label{wxactivexeventparamcount}
 
 
 \membersection{wxActiveXEvent::ParamCount}\label{wxactivexeventparamcount}
 
-\constfunc{int}{ParamCount}{\void}
+\constfunc{size_t}{ParamCount}{\void}
 
 Obtains the number of parameters passed through the activex event.
 
 
 \membersection{wxActiveXEvent::ParamType}\label{wxactivexeventparamtype}
 
 
 Obtains the number of parameters passed through the activex event.
 
 
 \membersection{wxActiveXEvent::ParamType}\label{wxactivexeventparamtype}
 
-\constfunc{wxString}{ParamType}{\param{int }{idx}}
+\constfunc{wxString}{ParamType}{\param{size_t }{idx}}
 
 Obtains the param type of the param number idx specifies as a string.
 
 
 \membersection{wxActiveXEvent::ParamName}\label{wxactivexeventparamname}
 
 
 Obtains the param type of the param number idx specifies as a string.
 
 
 \membersection{wxActiveXEvent::ParamName}\label{wxactivexeventparamname}
 
-\constfunc{wxString}{ParamName}{\param{int }{idx}}
+\constfunc{wxString}{ParamName}{\param{size_t }{idx}}
 
 Obtains the param name of the param number idx specifies as a string.
 
 
 \membersection{wxActiveXEvent::operator[]}\label{wxactivexeventoparray}
 
 
 Obtains the param name of the param number idx specifies as a string.
 
 
 \membersection{wxActiveXEvent::operator[]}\label{wxactivexeventoparray}
 
-\func{wxVariant&}{operator[]}{\param{int }{idx}}
+\func{wxVariant&}{operator[]}{\param{size_t }{idx}}
 
 Obtains the actual parameter value specified by idx.
 
 
 Obtains the actual parameter value specified by idx.
 
@@ -72,4 +72,3 @@ Obtains the actual parameter value specified by idx.
 
 Returns the dispatch id of this activex event. This is the numeric value from
 the .idl file specified by the id().
 
 Returns the dispatch id of this activex event. This is the numeric value from
 the .idl file specified by the id().
-
index e1c3d5602a70bbd812e07a2b74596781085f0c4c..c18baf3ea5ea2ade02651ac8b2fc97b3c0d9573e 100644 (file)
@@ -1,3 +1,14 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Name:        variant.tex
+%% Purpose:     wxVariant docs
+%% Author:      wxWidgets Team
+%% Modified by:
+%% Created:     01/30/2005
+%% RCS-ID:      $Id$
+%% Copyright:   (c) wxWidgets Team
+%% License:     wxWindows license
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 \section{\class{wxVariant}}\label{wxvariant}
 
 The {\bf wxVariant} class represents a container for any type.
 \section{\class{wxVariant}}\label{wxvariant}
 
 The {\bf wxVariant} class represents a container for any type.
@@ -79,7 +90,7 @@ Construction from user-defined data.  The variant holds onto the {\it data} poin
 
 \func{}{wxVariant}{\param{wxDateTime\&}{ val}, \param{const wxString\& }{name = ``"}}
 
 
 \func{}{wxVariant}{\param{wxDateTime\&}{ val}, \param{const wxString\& }{name = ``"}}
 
-Construction from a \helpref{wxDateTime}{wxdatetime}.  
+Construction from a \helpref{wxDateTime}{wxdatetime}.
 
 \func{}{wxVariant}{\param{wxArrayString\&}{ val}, \param{const wxString\& }{name = ``"}}
 
 
 \func{}{wxVariant}{\param{wxArrayString\&}{ val}, \param{const wxString\& }{name = ``"}}
 
@@ -136,13 +147,13 @@ Retrieves and converts the value of this variant to the type that {\it value} is
 
 \membersection{wxVariant::GetCount}\label{wxvariantgetcount}
 
 
 \membersection{wxVariant::GetCount}\label{wxvariantgetcount}
 
-\constfunc{int}{GetCount}{\void}
+\constfunc{size_t}{GetCount}{\void}
 
 Returns the number of elements in the list.
 
 \membersection{wxVariant::Delete}\label{wxvariantdelete}
 
 
 Returns the number of elements in the list.
 
 \membersection{wxVariant::Delete}\label{wxvariantdelete}
 
-\func{bool}{Delete}{\param{int }{item}}
+\func{bool}{Delete}{\param{size_t }{item}}
 
 Deletes the zero-based {\it item} from the list.
 
 
 Deletes the zero-based {\it item} from the list.
 
@@ -479,11 +490,10 @@ Writes the data to {\it stream} or {\it string}.
 
 This macro returns the data stored in {\it variant} cast to the type {\it classname *} if
 the data is of this type (the check is done during the run-time) or
 
 This macro returns the data stored in {\it variant} cast to the type {\it classname *} if
 the data is of this type (the check is done during the run-time) or
-{\tt NULL} otherwise. 
+{\tt NULL} otherwise.
 
 
 \wxheading{See also}
 
 \helpref{RTTI overview}{runtimeclassoverview}\\
 \helpref{wxDynamicCast}{wxdynamiccast}
 
 
 \wxheading{See also}
 
 \helpref{RTTI overview}{runtimeclassoverview}\\
 \helpref{wxDynamicCast}{wxdynamiccast}
-
index 49bae1ce86ebe09da637ce991ae4b2b508095496..31a9eb2a4c2e5a16ed023511ccaf01213f419c82 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        wx/activex.h
+// Name:        wx/msw/ole/activex.h
 // Purpose:     wxActiveXContainer class
 // Author:      Ryan Norton <wxprojects@comcast.net>
 // Modified by:
 // Purpose:     wxActiveXContainer class
 // Author:      Ryan Norton <wxprojects@comcast.net>
 // Modified by:
@@ -196,24 +196,24 @@ public:
     virtual wxEvent *Clone() const
     { return new wxActiveXEvent(*this); }
 
     virtual wxEvent *Clone() const
     { return new wxActiveXEvent(*this); }
 
-    int ParamCount() const
+    size_t ParamCount() const
     {   return m_params.GetCount();  }
 
     {   return m_params.GetCount();  }
 
-    wxString ParamType(int idx) const
+    wxString ParamType(size_t idx) const
     {
     {
-        wxASSERT(idx >= 0 && idx < m_params.GetCount());
+        wxASSERT(idx < m_params.GetCount());
         return m_params[idx].GetType();
     }
 
         return m_params[idx].GetType();
     }
 
-    wxString ParamName(int idx) const
+    wxString ParamName(size_t idx) const
     {
     {
-        wxASSERT(idx >= 0 && idx < m_params.GetCount());
+        wxASSERT(idx < m_params.GetCount());
         return m_params[idx].GetName();
     }
 
         return m_params[idx].GetName();
     }
 
-    wxVariant& operator[] (int idx)
+    wxVariant& operator[] (size_t idx)
     {
     {
-        wxASSERT(idx >= 0 && idx < ParamCount());
+        wxASSERT(idx < ParamCount());
         return m_params[idx];
     }
 
         return m_params[idx];
     }
 
@@ -229,4 +229,3 @@ typedef void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&);
     (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxActiveXEventFunction, &func)
 
 #endif // _WX_MSW_OLE_ACTIVEXCONTAINER_H_
     (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxActiveXEventFunction, &func)
 
 #endif // _WX_MSW_OLE_ACTIVEXCONTAINER_H_
-
index 707b009d43bcef299d9524e51fdfc6f61d1e558c..c8d99a3de8f6ecfddafdd328ff9e07455d4f2f4f 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        variant.h
+// Name:        wx/variant.h
 // Purpose:     wxVariant class, container for any type
 // Author:      Julian Smart
 // Modified by:
 // Purpose:     wxVariant class, container for any type
 // Author:      Julian Smart
 // Modified by:
@@ -207,7 +207,7 @@ public:
     bool IsValueKindOf(const wxClassInfo* type) const;
 
     // Return the number of elements in a list
     bool IsValueKindOf(const wxClassInfo* type) const;
 
     // Return the number of elements in a list
-    int GetCount() const;
+    size_t GetCount() const;
 
 // Value accessors
     double GetReal() const ;
 
 // Value accessors
     double GetReal() const ;
@@ -245,7 +245,7 @@ public:
     bool Member(const wxVariant& value) const;
 
     // Deletes the nth element of the list
     bool Member(const wxVariant& value) const;
 
     // Deletes the nth element of the list
-    bool Delete(int item);
+    bool Delete(size_t item);
 
     // Clear list
     void ClearList();
 
     // Clear list
     void ClearList();
index 2c540d3f3c12d9d9194e051c46f72683861c2331..7afa1c3183f2f3ffbd274aa4017739621366f16f 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        variant.cpp
+// Name:        src/common/variant.cpp
 // Purpose:     wxVariant class, container for any type
 // Author:      Julian Smart
 // Modified by:
 // Purpose:     wxVariant class, container for any type
 // Author:      Julian Smart
 // Modified by:
@@ -1730,14 +1730,14 @@ wxVariant wxVariant::operator[] (size_t idx) const
     if (GetType() == wxT("list"))
     {
         wxVariantDataList* data = (wxVariantDataList*) m_data;
     if (GetType() == wxT("list"))
     {
         wxVariantDataList* data = (wxVariantDataList*) m_data;
-        wxASSERT_MSG( (idx < (size_t) data->GetValue().GetCount()), wxT("Invalid index for array") );
+        wxASSERT_MSG( (idx < data->GetValue().GetCount()), wxT("Invalid index for array") );
         return * (wxVariant*) (data->GetValue().Item(idx)->GetData());
     }
 #if WXWIN_COMPATIBILITY_2_4
     else if (GetType() == wxT("stringlist"))
     {
         wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
         return * (wxVariant*) (data->GetValue().Item(idx)->GetData());
     }
 #if WXWIN_COMPATIBILITY_2_4
     else if (GetType() == wxT("stringlist"))
     {
         wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
-        wxASSERT_MSG( (idx < (size_t) data->GetValue().GetCount()), wxT("Invalid index for array") );
+        wxASSERT_MSG( (idx < data->GetValue().GetCount()), wxT("Invalid index for array") );
 
         wxString str( (const wxChar*) (data->GetValue().Item(idx)->GetData()) );
         wxVariant variant( str );
 
         wxString str( (const wxChar*) (data->GetValue().Item(idx)->GetData()) );
         wxVariant variant( str );
@@ -1755,13 +1755,13 @@ wxVariant& wxVariant::operator[] (size_t idx)
     wxASSERT_MSG( (GetType() == wxT("list")), wxT("Invalid type for array operator") );
 
     wxVariantDataList* data = (wxVariantDataList*) m_data;
     wxASSERT_MSG( (GetType() == wxT("list")), wxT("Invalid type for array operator") );
 
     wxVariantDataList* data = (wxVariantDataList*) m_data;
-    wxASSERT_MSG( (idx < (size_t) data->GetValue().GetCount()), wxT("Invalid index for array") );
+    wxASSERT_MSG( (idx < data->GetValue().GetCount()), wxT("Invalid index for array") );
 
     return * (wxVariant*) (data->GetValue().Item(idx)->GetData());
 }
 
 // Return the number of elements in a list
 
     return * (wxVariant*) (data->GetValue().Item(idx)->GetData());
 }
 
 // Return the number of elements in a list
-int wxVariant::GetCount() const
+size_t wxVariant::GetCount() const
 {
 #if WXWIN_COMPATIBILITY_2_4
     wxASSERT_MSG( (GetType() == wxT("list") || GetType() == wxT("stringlist")), wxT("Invalid type for GetCount()") );
 {
 #if WXWIN_COMPATIBILITY_2_4
     wxASSERT_MSG( (GetType() == wxT("list") || GetType() == wxT("stringlist")), wxT("Invalid type for GetCount()") );
@@ -1970,11 +1970,11 @@ bool wxVariant::Member(const wxVariant& value) const
 }
 
 // Deletes the nth element of the list
 }
 
 // Deletes the nth element of the list
-bool wxVariant::Delete(int item)
+bool wxVariant::Delete(size_t item)
 {
     wxList& list = GetList();
 
 {
     wxList& list = GetList();
 
-    wxASSERT_MSG( (item < (int) list.GetCount()), wxT("Invalid index to Delete") );
+    wxASSERT_MSG( (item < list.GetCount()), wxT("Invalid index to Delete") );
     wxList::compatibility_iterator node = list.Item(item);
     wxVariant* variant = (wxVariant*) node->GetData();
     delete variant;
     wxList::compatibility_iterator node = list.Item(item);
     wxVariant* variant = (wxVariant*) node->GetData();
     delete variant;
@@ -2105,4 +2105,3 @@ bool wxVariant::Convert(wxDateTime* value) const
                 (value->ParseDateTime(val) || value->ParseDate(val));
 }
 #endif // wxUSE_DATETIME
                 (value->ParseDateTime(val) || value->ParseDate(val));
 }
 #endif // wxUSE_DATETIME
-