replaced all int/size_t indices in wxControlWithItems API with unsigned int (committing on behalf of ABX)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
5aa67d6619
commit
aa61d35253
@ -45,11 +45,11 @@ All:
|
||||
- Added support for wxLongLong in wx stream classes (Mark Junker).
|
||||
- wxSOCKET_REUSEADDR can be used with wxSocketClient.
|
||||
- Overloaded Connect() and SetLocal() methods for binding to local address/port.
|
||||
- All GetCount() methods now return size_t and not int.
|
||||
- Albanian translation added (Besnik Bleta).
|
||||
- Assert messages now show the function in which assert failed.
|
||||
- wxApp::OnAssertFailure() should now be used instead the old wxApp::OnAssert().
|
||||
- Fixed several bugs in wxDateTime::ParseDate().
|
||||
- All GetCount() methods now return unsigned int and not int
|
||||
- Albanian translation added (Besnik Bleta)
|
||||
- Assert messages now show the function in which assert failed
|
||||
- wxApp::OnAssertFailure() should now be used instead the old wxApp::OnAssert()
|
||||
- Fixed several bugs in wxDateTime::ParseDate()
|
||||
|
||||
All (GUI):
|
||||
|
||||
|
@ -1,3 +1,14 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: checklst.tex
|
||||
%% Purpose: wxCheckListBox documentation
|
||||
%% Author: wxWidgets Team
|
||||
%% Modified by:
|
||||
%% Created:
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) wxWidgets Team
|
||||
%% License: wxWindows license
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxCheckListBox}}\label{wxchecklistbox}
|
||||
|
||||
A checklistbox is like a listbox, but allows items to be checked or unchecked.
|
||||
@ -107,12 +118,10 @@ wxEVT\_COMMAND\_CHECKLISTBOX\_TOGGLE being emitted.
|
||||
|
||||
\membersection{wxCheckListBox::IsChecked}\label{wxchecklistboxischecked}
|
||||
|
||||
\constfunc{bool}{IsChecked}{\param{int}{ item}}
|
||||
\constfunc{bool}{IsChecked}{\param{unsigned int}{ item}}
|
||||
|
||||
Returns true if the given item is checked, false otherwise.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{item}{Index of item whose check status is to be returned.}
|
||||
|
||||
|
||||
|
@ -1,3 +1,14 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: treectrl.tex
|
||||
%% Purpose: wxChoice documentation
|
||||
%% Author: wxWidgets Team
|
||||
%% Modified by:
|
||||
%% Created:
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) wxWidgets Team
|
||||
%% License: wxWindows license
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxChoice}}\label{wxchoice}
|
||||
|
||||
A choice item is used to select one of a list of strings. Unlike a
|
||||
@ -113,17 +124,6 @@ Destructor, destroying the choice item.
|
||||
Creates the choice for two-step construction. See \helpref{wxChoice::wxChoice}{wxchoicector}.
|
||||
|
||||
|
||||
\membersection{wxChoice::Delete}\label{wxchoicedelete}
|
||||
|
||||
\func{void}{Delete}{\param{int }{n}}
|
||||
|
||||
Deletes the item with the given index from the control.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{n}{The item to delete.}
|
||||
|
||||
|
||||
\membersection{wxChoice::GetColumns}\label{wxchoicegetcolumns}
|
||||
|
||||
\constfunc{int}{GetColumns}{\void}
|
||||
@ -147,7 +147,7 @@ That is, while the dropdown list is shown, it returns the currently selected
|
||||
item in it. When it is not shown, its result is the same as for the other
|
||||
function.
|
||||
|
||||
\newsince{2.6.2} (before this version
|
||||
\newsince{2.6.2} (before this version
|
||||
\helpref{GetSelection}{wxcontrolwithitemsgetselection} itself behaved like
|
||||
this).
|
||||
|
||||
@ -166,4 +166,3 @@ Sets the number of columns in this choice item.
|
||||
|
||||
This is implemented for Motif only and doesn't do anything under other
|
||||
platforms.
|
||||
|
||||
|
@ -88,7 +88,7 @@ by the control.
|
||||
|
||||
\membersection{wxControlWithItems::Delete}\label{wxcontrolwithitemsdelete}
|
||||
|
||||
\func{void}{Delete}{\param{int}{ n}}
|
||||
\func{void}{Delete}{\param{unsigned int}{ n}}
|
||||
|
||||
Deletes an item from the control. The client data associated with the item
|
||||
will be also deleted if it is owned by the control.
|
||||
@ -125,7 +125,7 @@ not found.
|
||||
|
||||
\membersection{wxControlWithItems::GetClientData}\label{wxcontrolwithitemsgetclientdata}
|
||||
|
||||
\constfunc{void *}{GetClientData}{\param{int}{ n}}
|
||||
\constfunc{void *}{GetClientData}{\param{unsigned int}{ n}}
|
||||
|
||||
Returns a pointer to the client data associated with the given item (if any).
|
||||
It is an error to call this function for a control which doesn't have untyped
|
||||
@ -143,7 +143,7 @@ A pointer to the client data, or {\tt NULL} if not present.
|
||||
|
||||
\membersection{wxControlWithItems::GetClientObject}\label{wxcontrolwithitemsgetclientobject}
|
||||
|
||||
\constfunc{wxClientData *}{GetClientObject}{\param{int}{ n}}
|
||||
\constfunc{wxClientData *}{GetClientObject}{\param{unsigned int}{ n}}
|
||||
|
||||
Returns a pointer to the client data associated with the given item (if any).
|
||||
It is an error to call this function for a control which doesn't have typed
|
||||
@ -161,7 +161,7 @@ A pointer to the client data, or {\tt NULL} if not present.
|
||||
|
||||
\membersection{wxControlWithItems::GetCount}\label{wxcontrolwithitemsgetcount}
|
||||
|
||||
\constfunc{size\_t}{GetCount}{\void}
|
||||
\constfunc{unsigned int}{GetCount}{\void}
|
||||
|
||||
Returns the number of items in the control.
|
||||
|
||||
@ -195,7 +195,7 @@ with {\tt wxLB\_MULTIPLE} style.
|
||||
|
||||
\membersection{wxControlWithItems::GetString}\label{wxcontrolwithitemsgetstring}
|
||||
|
||||
\constfunc{wxString}{GetString}{\param{int}{ n}}
|
||||
\constfunc{wxString}{GetString}{\param{unsigned int}{ n}}
|
||||
|
||||
Returns the label of the item with the given index.
|
||||
|
||||
@ -222,14 +222,14 @@ selected.
|
||||
|
||||
\membersection{wxControlWithItems::Insert}\label{wxcontrolwithitemsinsert}
|
||||
|
||||
\func{int}{Insert}{\param{const wxString\& }{ item}, \param{int }{pos}}
|
||||
\func{int}{Insert}{\param{const wxString\& }{ item}, \param{unsigned int }{pos}}
|
||||
|
||||
Inserts the item into the list before pos.
|
||||
Not valid for {\tt wxLB\_SORT} or {\tt wxCB\_SORT} styles, use Append instead.
|
||||
|
||||
\func{int}{Insert}{\param{const wxString\& }{ item}, \param{int }{pos}, \param{void *}{clientData}}
|
||||
\func{int}{Insert}{\param{const wxString\& }{ item}, \param{unsigned int }{pos}, \param{void *}{clientData}}
|
||||
|
||||
\func{int}{Insert}{\param{const wxString\& }{ item}, \param{int }{pos}, \param{wxClientData *}{clientData}}
|
||||
\func{int}{Insert}{\param{const wxString\& }{ item}, \param{unsigned int }{pos}, \param{wxClientData *}{clientData}}
|
||||
|
||||
Inserts the item into the list before pos, associating the given, typed or
|
||||
untyped, client data pointer with the item.
|
||||
@ -282,7 +282,7 @@ multiple selection.
|
||||
|
||||
\membersection{wxControlWithItems::SetClientData}\label{wxcontrolwithitemssetclientdata}
|
||||
|
||||
\func{void}{SetClientData}{\param{int}{ n}, \param{void *}{data}}
|
||||
\func{void}{SetClientData}{\param{unsigned int}{ n}, \param{void *}{data}}
|
||||
|
||||
Associates the given untyped client data pointer with the given item. Note that
|
||||
it is an error to call this function if any typed client data pointers had been
|
||||
@ -297,7 +297,7 @@ associated with the control items before.
|
||||
|
||||
\membersection{wxControlWithItems::SetClientObject}\label{wxcontrolwithitemssetclientobject}
|
||||
|
||||
\func{void}{SetClientObject}{\param{int}{ n}, \param{wxClientData *}{data}}
|
||||
\func{void}{SetClientObject}{\param{unsigned int}{ n}, \param{wxClientData *}{data}}
|
||||
|
||||
Associates the given typed client data pointer with the given item: the
|
||||
{\it data} object will be deleted when the item is deleted (either explicitly
|
||||
@ -336,7 +336,7 @@ deselect any other items in the controls which support multiple selections.
|
||||
|
||||
\membersection{wxControlWithItems::SetString}\label{wxcontrolwithitemssetstring}
|
||||
|
||||
\func{void}{SetString}{\param{int}{ n}, \param{const wxString\& }{ string}}
|
||||
\func{void}{SetString}{\param{unsigned int}{ n}, \param{const wxString\& }{ string}}
|
||||
|
||||
Sets the label for the given item.
|
||||
|
||||
|
@ -149,7 +149,7 @@ for further details.
|
||||
|
||||
Enables or disables the entire radiobox.
|
||||
|
||||
\func{virtual bool}{Enable}{\param{int}{ n}, \param{bool}{ enable = {\tt true}}}
|
||||
\func{virtual bool}{Enable}{\param{unsigned int}{ n}, \param{bool}{ enable = {\tt true}}}
|
||||
|
||||
Enables or disables an individual button in the radiobox.
|
||||
|
||||
@ -188,7 +188,7 @@ Finds a button matching the given string, returning the position if found, or
|
||||
|
||||
\membersection{wxRadioBox::GetColumnCount}\label{wxradioboxgetcolumncount}
|
||||
|
||||
\constfunc{int}{GetColumnCount}{\void}
|
||||
\constfunc{unsigned int}{GetColumnCount}{\void}
|
||||
|
||||
Returns the number of columns in the radiobox.
|
||||
|
||||
@ -218,7 +218,7 @@ implements the following methods:\par
|
||||
|
||||
\membersection{wxRadioBox::GetRowCount}\label{wxradioboxgetrowcount}
|
||||
|
||||
\constfunc{int}{GetRowCount}{\void}
|
||||
\constfunc{unsigned int}{GetRowCount}{\void}
|
||||
|
||||
Returns the number of rows in the radiobox.
|
||||
|
||||
@ -239,7 +239,7 @@ Returns the selected string.
|
||||
|
||||
\membersection{wxRadioBox::GetString}\label{wxradioboxgetstring}
|
||||
|
||||
\constfunc{wxString}{GetString}{\param{int}{ n}}
|
||||
\constfunc{wxString}{GetString}{\param{unsigned int}{ n}}
|
||||
|
||||
Returns the label for the button at the given position.
|
||||
|
||||
@ -250,7 +250,7 @@ Returns the label for the button at the given position.
|
||||
|
||||
\membersection{wxRadioBox::IsItemEnabled}\label{wxradioboxisitemenabled}
|
||||
|
||||
\constfunc{bool}{IsItemEnabled}{\void}
|
||||
\constfunc{bool}{IsItemEnabled}{\param{unsigned int}{ n}}
|
||||
|
||||
Returns \true if the item is enabled or \false if it was disabled using
|
||||
\helpref{Enable(n, false)}{wxradioboxenable}.
|
||||
@ -258,10 +258,14 @@ Returns \true if the item is enabled or \false if it was disabled using
|
||||
{\bf Platform note:} Currently only implemented in wxMSW, wxGTK and wxUniversal
|
||||
and always returns \true in the other ports.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{n}{The zero-based button position.}
|
||||
|
||||
|
||||
\membersection{wxRadioBox::IsItemShown}\label{wxradioboxisitemshown}
|
||||
|
||||
\constfunc{bool}{IsItemShown}{\void}
|
||||
\constfunc{bool}{IsItemShown}{\param{unsigned int}{ n}}
|
||||
|
||||
Returns \true if the item is currently shown or \false if it was hidden using
|
||||
\helpref{Show(n, false)}{wxradioboxshow}.
|
||||
@ -272,6 +276,10 @@ if the entire radiobox is not currently shown.
|
||||
{\bf Platform note:} Currently only implemented in wxMSW, wxGTK and wxUniversal
|
||||
and always returns \true in the other ports.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{n}{The zero-based button position.}
|
||||
|
||||
|
||||
\membersection{wxRadioBox::SetLabel}\label{wxradioboxsetlabel}
|
||||
|
||||
@ -325,7 +333,7 @@ a wxEVT\_COMMAND\_RADIOBOX\_SELECTED event to get emitted.
|
||||
|
||||
Shows or hides the entire radiobox.
|
||||
|
||||
\func{virtual bool}{Show}{\param{int}{ item}, \param{const bool}{ show = {\tt true}}}
|
||||
\func{virtual bool}{Show}{\param{unsigned int}{ item}, \param{const bool}{ show = {\tt true}}}
|
||||
|
||||
Shows or hides individual buttons.
|
||||
|
||||
|
@ -362,7 +362,7 @@ This function is only available in the generic version.
|
||||
|
||||
\membersection{wxTreeCtrl::GetChildrenCount}\label{wxtreectrlgetchildrencount}
|
||||
|
||||
\constfunc{size\_t}{GetChildrenCount}{\param{const wxTreeItemId\&}{ item}, \param{bool}{ recursively = {\tt true}}}
|
||||
\constfunc{unsigned int}{GetChildrenCount}{\param{const wxTreeItemId\&}{ item}, \param{bool}{ recursively = {\tt true}}}
|
||||
|
||||
Returns the number of items in the branch. If {\it recursively} is {\tt true}, returns the total number
|
||||
of descendants, otherwise only one level of children is counted.
|
||||
@ -370,7 +370,7 @@ of descendants, otherwise only one level of children is counted.
|
||||
|
||||
\membersection{wxTreeCtrl::GetCount}\label{wxtreectrlgetcount}
|
||||
|
||||
\constfunc{size\_t}{GetCount}{\void}
|
||||
\constfunc{unsigned int}{GetCount}{\void}
|
||||
|
||||
Returns the number of items in the control.
|
||||
|
||||
@ -631,7 +631,7 @@ this style.
|
||||
|
||||
\membersection{wxTreeCtrl::GetSelections}\label{wxtreectrlgetselections}
|
||||
|
||||
\constfunc{size\_t}{GetSelections}{\param{wxArrayTreeItemIds\& }{selection}}
|
||||
\constfunc{unsigned int}{GetSelections}{\param{wxArrayTreeItemIds\& }{selection}}
|
||||
|
||||
Fills the array of tree items passed in with the currently selected items. This
|
||||
function can be called only if the control has the wxTR\_MULTIPLE style.
|
||||
|
@ -32,8 +32,8 @@ public:
|
||||
wxCheckListBoxBase() { }
|
||||
|
||||
// check list box specific methods
|
||||
virtual bool IsChecked(size_t item) const = 0;
|
||||
virtual void Check(size_t item, bool check = true) = 0;
|
||||
virtual bool IsChecked(unsigned int item) const = 0;
|
||||
virtual void Check(unsigned int item, bool check = true) = 0;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxCheckListBoxBase)
|
||||
};
|
||||
|
@ -4,9 +4,9 @@
|
||||
// Author: David Elliott
|
||||
// Modified by:
|
||||
// Created: 2003/03/16
|
||||
// RCS-ID: $Id:
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2003 David Elliott
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __WX_COCOA_CHECKLST_H__
|
||||
@ -73,8 +73,8 @@ protected:
|
||||
// ------------------------------------------------------------------------
|
||||
public:
|
||||
// check list box specific methods
|
||||
virtual bool IsChecked(size_t item) const;
|
||||
virtual void Check(size_t item, bool check = TRUE);
|
||||
virtual bool IsChecked(unsigned int item) const;
|
||||
virtual void Check(unsigned int item, bool check = true);
|
||||
};
|
||||
|
||||
#endif // __WX_COCOA_CHECKLST_H__
|
||||
|
@ -81,19 +81,19 @@ protected:
|
||||
// ------------------------------------------------------------------------
|
||||
public:
|
||||
virtual void Clear();
|
||||
virtual void Delete(int);
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int) const;
|
||||
virtual void SetString(int, const wxString&);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int) const;
|
||||
virtual void SetString(unsigned int pos, const wxString&);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual int GetSelection() const;
|
||||
virtual int DoAppend(const wxString&);
|
||||
virtual int DoInsert(const wxString&, int);
|
||||
virtual void DoSetItemClientData(int, void*);
|
||||
virtual void* DoGetItemClientData(int) const;
|
||||
virtual void DoSetItemClientObject(int, wxClientData*);
|
||||
virtual wxClientData* DoGetItemClientObject(int) const;
|
||||
virtual void SetSelection(int);
|
||||
virtual int DoInsert(const wxString&, unsigned int pos);
|
||||
virtual void DoSetItemClientData(unsigned int, void*);
|
||||
virtual void* DoGetItemClientData(unsigned int) const;
|
||||
virtual void DoSetItemClientObject(unsigned int, wxClientData*);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int) const;
|
||||
virtual void SetSelection(int pos);
|
||||
protected:
|
||||
wxSortedArrayString *m_sortedStrings;
|
||||
wxArrayPtrVoid m_itemsClientData;
|
||||
|
@ -102,23 +102,23 @@ protected:
|
||||
// ------------------------------------------------------------------------
|
||||
public:
|
||||
// wxCombobox methods
|
||||
virtual void SetSelection(int);
|
||||
virtual void SetSelection(int pos);
|
||||
// Overlapping methods
|
||||
virtual wxString GetStringSelection();
|
||||
// wxItemContainer
|
||||
virtual void Clear();
|
||||
virtual void Delete(int);
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int) const;
|
||||
virtual void SetString(int, const wxString&);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int) const;
|
||||
virtual void SetString(unsigned int pos, const wxString&);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual int GetSelection() const;
|
||||
virtual int DoAppend(const wxString&);
|
||||
virtual int DoInsert(const wxString&, int);
|
||||
virtual void DoSetItemClientData(int, void*);
|
||||
virtual void* DoGetItemClientData(int) const;
|
||||
virtual void DoSetItemClientObject(int, wxClientData*);
|
||||
virtual wxClientData* DoGetItemClientObject(int) const;
|
||||
virtual int DoInsert(const wxString&, unsigned int pos);
|
||||
virtual void DoSetItemClientData(unsigned int, void*);
|
||||
virtual void* DoGetItemClientData(unsigned int) const;
|
||||
virtual void DoSetItemClientObject(unsigned int, wxClientData*);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int) const;
|
||||
// wxComboBoxBase pure virtuals
|
||||
virtual wxString GetValue() const
|
||||
{ return wxTextCtrl::GetValue(); }
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
virtual bool IsSelected(int n) const;
|
||||
virtual int GetSelections(wxArrayInt& aSelections) const;
|
||||
protected:
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
virtual void DoSetFirstItem(int n);
|
||||
virtual void DoSetSelection(int n, bool select);
|
||||
@ -93,20 +93,20 @@ protected:
|
||||
public:
|
||||
// deleting items
|
||||
virtual void Clear();
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
// accessing strings
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
// selection
|
||||
virtual int GetSelection() const;
|
||||
protected:
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
};
|
||||
|
||||
#endif // __WX_COCOA_LISTBOX_H__
|
||||
|
@ -85,12 +85,12 @@ public:
|
||||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const;
|
||||
// string access
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& label);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& label);
|
||||
// change the individual radio button state
|
||||
virtual bool Enable(int n, bool enable = true);
|
||||
virtual bool Show(int n, bool show = true);
|
||||
virtual bool Enable(unsigned int n, bool enable = true);
|
||||
virtual bool Show(unsigned int n, bool show = true);
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
};
|
||||
|
@ -38,24 +38,24 @@ public:
|
||||
// accessing strings
|
||||
// -----------------
|
||||
|
||||
virtual size_t GetCount() const = 0;
|
||||
virtual unsigned int GetCount() const = 0;
|
||||
bool IsEmpty() const { return GetCount() == 0; }
|
||||
|
||||
virtual wxString GetString(int n) const = 0;
|
||||
virtual wxString GetString(unsigned int n) const = 0;
|
||||
wxArrayString GetStrings() const;
|
||||
virtual void SetString(int n, const wxString& s) = 0;
|
||||
virtual void SetString(unsigned int n, const wxString& s) = 0;
|
||||
|
||||
// finding string natively is either case sensitive or insensitive
|
||||
// but never both so fall back to this base version for not
|
||||
// supported search type
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const
|
||||
{
|
||||
size_t count = GetCount();
|
||||
unsigned int count = GetCount();
|
||||
|
||||
for ( size_t i = 0; i < count ; ++i )
|
||||
for ( unsigned int i = 0; i < count ; ++i )
|
||||
{
|
||||
if (GetString(i).IsSameAs( s , bCase ))
|
||||
return i;
|
||||
return (int)i;
|
||||
}
|
||||
|
||||
return wxNOT_FOUND;
|
||||
@ -82,9 +82,8 @@ public:
|
||||
protected:
|
||||
|
||||
// check that the index is valid
|
||||
// FIXME: once api will move to size_t, drop >= 0 check
|
||||
inline bool IsValid(int n) const { return n >= 0 && (size_t)n < GetCount(); }
|
||||
inline bool IsValidInsert(int n) const { return n >= 0 && (size_t)n <= GetCount(); }
|
||||
inline bool IsValid(unsigned int n) const { return n < GetCount(); }
|
||||
inline bool IsValidInsert(unsigned int n) const { return n <= GetCount(); }
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxItemContainer : public wxItemContainerImmutable
|
||||
@ -110,26 +109,26 @@ public:
|
||||
// append several items at once to the control
|
||||
void Append(const wxArrayString& strings);
|
||||
|
||||
int Insert(const wxString& item, int pos)
|
||||
int Insert(const wxString& item, unsigned int pos)
|
||||
{ return DoInsert(item, pos); }
|
||||
int Insert(const wxString& item, int pos, void *clientData);
|
||||
int Insert(const wxString& item, int pos, wxClientData *clientData);
|
||||
int Insert(const wxString& item, unsigned int pos, void *clientData);
|
||||
int Insert(const wxString& item, unsigned int pos, wxClientData *clientData);
|
||||
|
||||
// deleting items
|
||||
// --------------
|
||||
|
||||
virtual void Clear() = 0;
|
||||
virtual void Delete(int n) = 0;
|
||||
virtual void Delete(unsigned int n) = 0;
|
||||
|
||||
// misc
|
||||
// ----
|
||||
|
||||
// client data stuff
|
||||
void SetClientData(int n, void* clientData);
|
||||
void* GetClientData(int n) const;
|
||||
void SetClientData(unsigned int n, void* clientData);
|
||||
void* GetClientData(unsigned int n) const;
|
||||
|
||||
void SetClientObject(int n, wxClientData* clientData);
|
||||
wxClientData* GetClientObject(int n) const;
|
||||
void SetClientObject(unsigned int n, wxClientData* clientData);
|
||||
wxClientData* GetClientObject(unsigned int n) const;
|
||||
|
||||
bool HasClientObjectData() const
|
||||
{ return m_clientDataItemsType == wxClientData_Object; }
|
||||
@ -138,12 +137,12 @@ public:
|
||||
|
||||
protected:
|
||||
virtual int DoAppend(const wxString& item) = 0;
|
||||
virtual int DoInsert(const wxString& item, int pos) = 0;
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos) = 0;
|
||||
|
||||
virtual void DoSetItemClientData(int n, void* clientData) = 0;
|
||||
virtual void* DoGetItemClientData(int n) const = 0;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData) = 0;
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const = 0;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData) = 0;
|
||||
virtual void* DoGetItemClientData(unsigned int n) const = 0;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData) = 0;
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const = 0;
|
||||
|
||||
// the type of the client data for the items
|
||||
wxClientDataType m_clientDataItemsType;
|
||||
@ -162,13 +161,13 @@ protected:
|
||||
{ wxControl::SetClientObject(data); } \
|
||||
wxClientData *GetClientObject() const \
|
||||
{ return wxControl::GetClientObject(); } \
|
||||
void SetClientData(int n, void* clientData) \
|
||||
void SetClientData(unsigned int n, void* clientData) \
|
||||
{ wxItemContainer::SetClientData(n, clientData); } \
|
||||
void* GetClientData(int n) const \
|
||||
void* GetClientData(unsigned int n) const \
|
||||
{ return wxItemContainer::GetClientData(n); } \
|
||||
void SetClientObject(int n, wxClientData* clientData) \
|
||||
void SetClientObject(unsigned int n, wxClientData* clientData) \
|
||||
{ wxItemContainer::SetClientObject(n, clientData); } \
|
||||
wxClientData* GetClientObject(int n) const \
|
||||
wxClientData* GetClientObject(unsigned int n) const \
|
||||
{ return wxItemContainer::GetClientObject(n); }
|
||||
|
||||
class WXDLLEXPORT wxControlWithItems : public wxControl, public wxItemContainer
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: checklst.h
|
||||
// Name: wx/gtk/checklst.h
|
||||
// Purpose: wxCheckListBox class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
@ -52,11 +52,11 @@ public:
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
bool IsChecked( int index ) const;
|
||||
void Check( int index, bool check = TRUE );
|
||||
bool IsChecked(unsigned int index) const;
|
||||
void Check(unsigned int index, bool check = true);
|
||||
|
||||
int GetItemHeight() const;
|
||||
|
||||
|
||||
#if wxUSE_NATIVEGTKCHECKLIST
|
||||
void DoCreateCheckList();
|
||||
#endif
|
||||
|
@ -62,17 +62,17 @@ public:
|
||||
const wxString& name = wxChoiceNameStr );
|
||||
|
||||
// implement base class pure virtuals
|
||||
void Delete(int n);
|
||||
void Delete(unsigned int n);
|
||||
void Clear();
|
||||
|
||||
int GetSelection() const;
|
||||
int GetCurrentSelection() const { return GetSelection(); }
|
||||
void SetSelection( int n );
|
||||
void SetSelection(int n);
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
wxString GetString( int n ) const;
|
||||
void SetString( int n, const wxString& string );
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& string);
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
@ -84,18 +84,18 @@ protected:
|
||||
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
|
||||
virtual void DoSetItemClientData( int n, void* clientData );
|
||||
virtual void* DoGetItemClientData( int n ) const;
|
||||
virtual void DoSetItemClientObject( int n, wxClientData* clientData );
|
||||
virtual wxClientData* DoGetItemClientObject( int n ) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
// common part of Create() and DoAppend()
|
||||
int GtkAddHelper(GtkWidget *menu, size_t pos, const wxString& item);
|
||||
int GtkAddHelper(GtkWidget *menu, unsigned int pos, const wxString& item);
|
||||
|
||||
// this array is only used for controls with wxCB_SORT style, so only
|
||||
// allocate it if it's needed (hence using pointer)
|
||||
|
@ -81,16 +81,16 @@ public:
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
|
||||
void Clear();
|
||||
void Delete( int n );
|
||||
void Delete(unsigned int n);
|
||||
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
int GetSelection() const;
|
||||
int GetCurrentSelection() const;
|
||||
wxString GetString( int n ) const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
wxString GetStringSelection() const;
|
||||
virtual size_t GetCount() const;
|
||||
void SetSelection( int n );
|
||||
void SetString(int n, const wxString &text);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual void SetSelection(int n);
|
||||
virtual void SetString(unsigned int n, const wxString &text);
|
||||
|
||||
wxString GetValue() const;
|
||||
void SetValue(const wxString& value);
|
||||
@ -160,12 +160,12 @@ public:
|
||||
protected:
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
|
||||
virtual void DoSetItemClientData( int n, void* clientData );
|
||||
virtual void* DoGetItemClientData( int n ) const;
|
||||
virtual void DoSetItemClientObject( int n, wxClientData* clientData );
|
||||
virtual wxClientData* DoGetItemClientObject( int n ) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
|
@ -63,11 +63,11 @@ public:
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Clear();
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
|
||||
virtual bool IsSelected(int n) const;
|
||||
@ -99,20 +99,20 @@ public:
|
||||
|
||||
struct _GtkTreeEntry* GtkGetEntry(int pos) const;
|
||||
void GtkInsertItems(const wxArrayString& items,
|
||||
void** clientData, size_t pos);
|
||||
void** clientData, unsigned int pos);
|
||||
void GtkSetSelection(int n, const bool select, const bool blockEvent);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual void DoSetSelection(int n, bool select);
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
virtual void DoSetFirstItem(int n);
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
virtual int DoListHitTest(const wxPoint& point) const;
|
||||
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
|
@ -81,21 +81,21 @@ public:
|
||||
|
||||
|
||||
// implement wxItemContainerImmutable methods
|
||||
virtual size_t GetCount() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const;
|
||||
|
||||
|
||||
// implement wxRadioBoxBase methods
|
||||
virtual bool Show(int n, bool show = true);
|
||||
virtual bool Enable(int n, bool enable = true);
|
||||
virtual bool Show(unsigned int n, bool show = true);
|
||||
virtual bool Enable(unsigned int n, bool enable = true);
|
||||
|
||||
virtual bool IsItemEnabled(int n) const;
|
||||
virtual bool IsItemShown(int n) const;
|
||||
virtual bool IsItemEnabled(unsigned int n) const;
|
||||
virtual bool IsItemShown(unsigned int n) const;
|
||||
|
||||
|
||||
// override some base class methods to operate on radiobox itself too
|
||||
|
@ -48,8 +48,8 @@ public:
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
bool IsChecked( int index ) const;
|
||||
void Check( int index, bool check = TRUE );
|
||||
bool IsChecked(unsigned int index) const;
|
||||
void Check(unsigned int index, bool check = true);
|
||||
|
||||
int GetItemHeight() const;
|
||||
|
||||
|
@ -62,17 +62,17 @@ public:
|
||||
const wxString& name = wxChoiceNameStr );
|
||||
|
||||
// implement base class pure virtuals
|
||||
void Delete(int n);
|
||||
void Delete(unsigned int n);
|
||||
void Clear();
|
||||
|
||||
int GetSelection() const;
|
||||
int GetCurrentSelection() const { return GetSelection(); }
|
||||
void SetSelection( int n );
|
||||
virtual void SetSelection(int n);
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
wxString GetString( int n ) const;
|
||||
void SetString( int n, const wxString& string );
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& string);
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
@ -82,12 +82,12 @@ protected:
|
||||
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
|
||||
virtual void DoSetItemClientData( int n, void* clientData );
|
||||
virtual void* DoGetItemClientData( int n ) const;
|
||||
virtual void DoSetItemClientObject( int n, wxClientData* clientData );
|
||||
virtual wxClientData* DoGetItemClientObject( int n ) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
@ -95,7 +95,7 @@ protected:
|
||||
|
||||
private:
|
||||
// common part of Create() and DoAppend()
|
||||
int GtkAddHelper(GtkWidget *menu, size_t pos, const wxString& item);
|
||||
int GtkAddHelper(GtkWidget *menu, unsigned int pos, const wxString& item);
|
||||
|
||||
// this array is only used for controls with wxCB_SORT style, so only
|
||||
// allocate it if it's needed (hence using pointer)
|
||||
|
@ -81,16 +81,16 @@ public:
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
|
||||
void Clear();
|
||||
void Delete( int n );
|
||||
void Delete(unsigned int n);
|
||||
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
int GetSelection() const;
|
||||
int GetCurrentSelection() const;
|
||||
wxString GetString( int n ) const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
wxString GetStringSelection() const;
|
||||
virtual size_t GetCount() const;
|
||||
void SetSelection( int n );
|
||||
void SetString(int n, const wxString &text);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual void SetSelection(int n);
|
||||
virtual void SetString(unsigned int n, const wxString &text);
|
||||
|
||||
wxString GetValue() const;
|
||||
void SetValue(const wxString& value);
|
||||
@ -160,12 +160,12 @@ public:
|
||||
|
||||
protected:
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
|
||||
virtual void DoSetItemClientData( int n, void* clientData );
|
||||
virtual void* DoGetItemClientData( int n ) const;
|
||||
virtual void DoSetItemClientObject( int n, wxClientData* clientData );
|
||||
virtual wxClientData* DoGetItemClientObject( int n ) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
|
@ -68,11 +68,11 @@ public:
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Clear();
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
|
||||
virtual bool IsSelected(int n) const;
|
||||
@ -81,15 +81,15 @@ public:
|
||||
virtual int GetSelections(wxArrayInt& aSelections) const;
|
||||
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
|
||||
virtual void DoSetFirstItem(int n);
|
||||
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
@ -81,21 +81,21 @@ public:
|
||||
|
||||
|
||||
// implement wxItemContainerImmutable methods
|
||||
virtual size_t GetCount() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const;
|
||||
|
||||
|
||||
// implement wxRadioBoxBase methods
|
||||
virtual bool Show(int n, bool show = true);
|
||||
virtual bool Enable(int n, bool enable = true);
|
||||
virtual bool Show(unsigned int n, bool show = true);
|
||||
virtual bool Enable(unsigned int n, bool enable = true);
|
||||
|
||||
virtual bool IsItemEnabled(int n) const;
|
||||
virtual bool IsItemShown(int n) const;
|
||||
virtual bool IsItemEnabled(unsigned int n) const;
|
||||
virtual bool IsItemShown(unsigned int n) const;
|
||||
|
||||
|
||||
// override some base class methods to operate on radiobox itself too
|
||||
|
@ -44,15 +44,15 @@ public:
|
||||
|
||||
// all generic methods are in wxControlWithItems, except for the following
|
||||
// ones which are not yet implemented by wxChoice/wxComboBox
|
||||
void Insert(const wxString& item, int pos)
|
||||
void Insert(const wxString& item, unsigned int pos)
|
||||
{ DoInsert(item, pos); }
|
||||
void Insert(const wxString& item, int pos, void *clientData)
|
||||
void Insert(const wxString& item, unsigned int pos, void *clientData)
|
||||
{ DoInsert(item, pos); SetClientData(pos, clientData); }
|
||||
void Insert(const wxString& item, int pos, wxClientData *clientData)
|
||||
void Insert(const wxString& item, unsigned int pos, wxClientData *clientData)
|
||||
{ DoInsert(item, pos); SetClientObject(pos, clientData); }
|
||||
|
||||
void InsertItems(int nItems, const wxString *items, int pos);
|
||||
void InsertItems(const wxArrayString& items, int pos)
|
||||
void InsertItems(unsigned int nItems, const wxString *items, unsigned int pos);
|
||||
void InsertItems(const wxArrayString& items, unsigned int pos)
|
||||
{ DoInsertItems(items, pos); }
|
||||
|
||||
void Set(int n, const wxString* items, void **clientData = NULL);
|
||||
@ -113,11 +113,11 @@ public:
|
||||
protected:
|
||||
// NB: due to wxGTK implementation details, DoInsert() is implemented
|
||||
// using DoInsertItems() and not the other way round
|
||||
virtual int DoInsert(const wxString& item, int pos)
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos)
|
||||
{ InsertItems(1, &item, pos); return pos; }
|
||||
|
||||
// to be implemented in derived classes
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos) = 0;
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos) = 0;
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData) = 0;
|
||||
|
||||
virtual void DoSetFirstItem(int n) = 0;
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: checklst.h
|
||||
// Name: wx/mac/carbon/checklst.h
|
||||
// Purpose: wxCheckListBox class - a listbox with checkable items
|
||||
// Note: this is an optional class.
|
||||
// Author: Stefan Csomor
|
||||
@ -13,10 +13,6 @@
|
||||
#ifndef _WX_CHECKLST_H_
|
||||
#define _WX_CHECKLST_H_
|
||||
|
||||
#if !defined(__MWERKS__) && !defined(__UNIX__)
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxCheckListBox : public wxCheckListBoxBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCheckListBox)
|
||||
@ -70,19 +66,19 @@ public:
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
// items may be checked
|
||||
bool IsChecked(size_t uiIndex) const;
|
||||
void Check(size_t uiIndex, bool bCheck = TRUE);
|
||||
bool IsChecked(unsigned int uiIndex) const;
|
||||
void Check(unsigned int uiIndex, bool bCheck = true);
|
||||
|
||||
|
||||
// override all methods which add/delete items to update m_checks array as
|
||||
// well
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
// the array containing the checked status of the items
|
||||
wxArrayInt m_checks;
|
||||
|
||||
protected:
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
virtual void DoClear();
|
||||
// common part of all ctors
|
||||
|
@ -69,28 +69,28 @@ public:
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxChoiceNameStr);
|
||||
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual void Clear();
|
||||
|
||||
virtual size_t GetCount() const ;
|
||||
virtual unsigned int GetCount() const ;
|
||||
virtual int GetSelection() const ;
|
||||
virtual void SetSelection(int n);
|
||||
int GetCurrentSelection() const { return GetSelection(); }
|
||||
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual wxString GetString(int n) const ;
|
||||
virtual void SetString( int , const wxString& s ) ;
|
||||
virtual wxString GetString(unsigned int n) const ;
|
||||
virtual void SetString(unsigned int pos, const wxString& s);
|
||||
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const ;
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
|
||||
virtual void DoSetItemClientData( int n, void* clientData );
|
||||
virtual void* DoGetItemClientData( int n ) const;
|
||||
virtual void DoSetItemClientObject( int n, wxClientData* clientData );
|
||||
virtual wxClientData* DoGetItemClientObject( int n ) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
// free all memory we have (used by Clear() and dtor)
|
||||
// prevent collision with some BSD definitions of macro Free()
|
||||
|
@ -85,16 +85,16 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
|
||||
// List functions
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual void Clear();
|
||||
|
||||
virtual int GetSelection() const;
|
||||
int GetCurrentSelection() const { return GetSelection(); }
|
||||
virtual void SetSelection(int n);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual wxString GetStringSelection() const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
// Text field functions
|
||||
virtual wxString GetValue() const;
|
||||
@ -114,7 +114,7 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
|
||||
virtual void SetEditable(bool editable);
|
||||
virtual bool IsEditable() const;
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
|
||||
virtual void Undo();
|
||||
virtual void Redo();
|
||||
@ -143,12 +143,12 @@ protected:
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void * DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData * DoGetItemClientObject(int n) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void * DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData * DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
// the subcontrols
|
||||
wxComboBoxText* m_text;
|
||||
|
@ -75,11 +75,11 @@ public:
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Clear();
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
|
||||
virtual bool IsSelected(int n) const;
|
||||
@ -105,13 +105,13 @@ public:
|
||||
protected:
|
||||
virtual void DoSetSelection(int n, bool select);
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
virtual void DoSetFirstItem(int n);
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
virtual int DoListHitTest(const wxPoint& point) const;
|
||||
|
||||
@ -132,7 +132,7 @@ protected:
|
||||
// prevent collision with some BSD definitions of macro Free()
|
||||
void FreeData();
|
||||
|
||||
size_t m_noItems;
|
||||
unsigned int m_noItems;
|
||||
int m_selected;
|
||||
bool m_suppressSelection ;
|
||||
wxString m_typeIn ;
|
||||
|
@ -58,13 +58,13 @@ public:
|
||||
virtual void SetSelection(int item);
|
||||
virtual int GetSelection() const;
|
||||
|
||||
virtual size_t GetCount() const { return m_noItems; } ;
|
||||
virtual unsigned int GetCount() const { return m_noItems; }
|
||||
|
||||
virtual wxString GetString(int item) const;
|
||||
virtual void SetString(int item, const wxString& label) ;
|
||||
virtual wxString GetString(unsigned int item) const;
|
||||
virtual void SetString(unsigned int item, const wxString& label);
|
||||
|
||||
virtual bool Enable(int item, bool enable = true);
|
||||
virtual bool Show(int item, bool show = true);
|
||||
virtual bool Enable(unsigned int item, bool enable = true);
|
||||
virtual bool Show(unsigned int item, bool show = true);
|
||||
|
||||
virtual bool Enable(bool enable = true);
|
||||
virtual wxString GetLabel() const;
|
||||
@ -84,7 +84,7 @@ public:
|
||||
protected:
|
||||
wxRadioButton *m_radioButtonCycle;
|
||||
|
||||
size_t m_noItems;
|
||||
unsigned int m_noItems;
|
||||
int m_noRowsOrCols;
|
||||
|
||||
// Internal functions
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: checklst.h
|
||||
// Name: wx/mac/classic/checklst.h
|
||||
// Purpose: wxCheckListBox class - a listbox with checkable items
|
||||
// Note: this is an optional class.
|
||||
// Author: Stefan Csomor
|
||||
@ -13,10 +13,6 @@
|
||||
#ifndef _WX_CHECKLST_H_
|
||||
#define _WX_CHECKLST_H_
|
||||
|
||||
#if !defined(__MWERKS__) && !defined(__UNIX__)
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxCheckListBox : public wxCheckListBoxBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCheckListBox)
|
||||
@ -70,8 +66,8 @@ public:
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
// items may be checked
|
||||
bool IsChecked(size_t uiIndex) const;
|
||||
void Check(size_t uiIndex, bool bCheck = TRUE);
|
||||
bool IsChecked(unsigned int uiIndex) const;
|
||||
void Check(unsigned int uiIndex, bool bCheck = true);
|
||||
void OnChar(wxKeyEvent& event) ;
|
||||
void OnLeftClick(wxMouseEvent& event) ;
|
||||
|
||||
@ -85,10 +81,10 @@ public:
|
||||
|
||||
// override all methods which add/delete items to update m_checks array as
|
||||
// well
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
protected:
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
virtual void DoClear();
|
||||
// common part of all ctors
|
||||
|
@ -71,26 +71,26 @@ public:
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual void Delete(int n);
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual void Clear();
|
||||
|
||||
virtual size_t GetCount() const ;
|
||||
virtual unsigned int GetCount() const ;
|
||||
virtual int GetSelection() const ;
|
||||
virtual void SetSelection(int n);
|
||||
|
||||
virtual wxString GetString(int n) const ;
|
||||
virtual void SetString( int , const wxString& s ) ;
|
||||
virtual wxString GetString(unsigned int n) const ;
|
||||
virtual void SetString(unsigned int pos, const wxString& s);
|
||||
void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ;
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const ;
|
||||
|
||||
public: // for wxComboBox only
|
||||
virtual void DoSetItemClientData( int n, void* clientData );
|
||||
virtual void* DoGetItemClientData( int n ) const;
|
||||
virtual void DoSetItemClientObject( int n, wxClientData* clientData );
|
||||
virtual wxClientData* DoGetItemClientObject( int n ) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData );
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
protected:
|
||||
// free all memory we have (used by Clear() and dtor)
|
||||
|
@ -78,15 +78,15 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
|
||||
// List functions
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual void Clear();
|
||||
|
||||
virtual int GetSelection() const ;
|
||||
virtual void SetSelection(int n);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual wxString GetString(int n) const ;
|
||||
virtual wxString GetString(unsigned int n) const ;
|
||||
virtual wxString GetStringSelection() const ;
|
||||
virtual void SetString(int n, const wxString& s) ;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
// Text field functions
|
||||
virtual wxString GetValue() const ;
|
||||
@ -104,7 +104,7 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
virtual size_t GetCount() const { return m_choice->GetCount() ; }
|
||||
virtual unsigned int GetCount() const { return m_choice->GetCount() ; }
|
||||
|
||||
virtual bool IsEditable() const ;
|
||||
|
||||
@ -124,12 +124,12 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
|
||||
|
||||
protected:
|
||||
virtual int DoAppend(const wxString& item) ;
|
||||
virtual int DoInsert(const wxString& item, int pos) ;
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos) ;
|
||||
|
||||
virtual void DoSetItemClientData(int n, void* clientData) ;
|
||||
virtual void* DoGetItemClientData(int n) const ;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData) ;
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const ;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const ;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const ;
|
||||
|
||||
void FreeData();
|
||||
|
||||
|
@ -85,11 +85,11 @@ public:
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Clear();
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
|
||||
virtual bool IsSelected(int n) const;
|
||||
@ -98,15 +98,15 @@ public:
|
||||
virtual int GetSelections(wxArrayInt& aSelections) const;
|
||||
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
|
||||
virtual void DoSetFirstItem(int n);
|
||||
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ;
|
||||
|
||||
// wxCheckListBox support
|
||||
@ -156,7 +156,7 @@ protected:
|
||||
// prevent collision with some BSD definitions of macro Free()
|
||||
void FreeData();
|
||||
|
||||
size_t m_noItems;
|
||||
unsigned int m_noItems;
|
||||
int m_selected;
|
||||
wxString m_typeIn ;
|
||||
long m_lastTypeIn ;
|
||||
|
@ -58,13 +58,13 @@ public:
|
||||
virtual void SetSelection(int item);
|
||||
virtual int GetSelection() const;
|
||||
|
||||
virtual size_t GetCount() const { return m_noItems; } ;
|
||||
virtual unsigned int GetCount() const { return m_noItems; }
|
||||
|
||||
virtual wxString GetString(int item) const;
|
||||
virtual void SetString(int item, const wxString& label) ;
|
||||
virtual wxString GetString(unsigned int item) const;
|
||||
virtual void SetString(unsigned int item, const wxString& label);
|
||||
|
||||
virtual bool Enable(int item, bool enable = true);
|
||||
virtual bool Show(int item, bool show = true);
|
||||
virtual bool Enable(unsigned int item, bool enable = true);
|
||||
virtual bool Show(unsigned int item, bool show = true);
|
||||
|
||||
virtual bool Enable(bool enable = true);
|
||||
virtual wxString GetLabel() const;
|
||||
@ -84,7 +84,7 @@ public:
|
||||
protected:
|
||||
wxRadioButton *m_radioButtonCycle;
|
||||
|
||||
size_t m_noItems;
|
||||
unsigned int m_noItems;
|
||||
int m_noRowsOrCols;
|
||||
|
||||
// Internal functions
|
||||
|
@ -56,16 +56,16 @@ public:
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
// items may be checked
|
||||
bool IsChecked(size_t uiIndex) const;
|
||||
void Check(size_t uiIndex, bool bCheck = true);
|
||||
bool IsChecked(unsigned int uiIndex) const;
|
||||
void Check(unsigned int uiIndex, bool bCheck = true);
|
||||
|
||||
// override base class functions
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
private:
|
||||
void DoToggleItem( int item, int x );
|
||||
|
@ -71,18 +71,18 @@ public:
|
||||
const wxString& name = wxChoiceNameStr);
|
||||
|
||||
// implementation of wxControlWithItems
|
||||
virtual size_t GetCount() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
virtual int GetSelection() const;
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual void Clear();
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
|
||||
// implementation of wxChoiceBase
|
||||
virtual void SetSelection(int n);
|
||||
@ -112,7 +112,7 @@ protected:
|
||||
// common part of all contructors
|
||||
void Init();
|
||||
|
||||
size_t m_noStrings;
|
||||
unsigned int m_noStrings;
|
||||
WXWidget m_menuWidget;
|
||||
WXWidget m_buttonWidget;
|
||||
wxWidgetArray m_widgetArray;
|
||||
|
@ -71,14 +71,14 @@ public:
|
||||
|
||||
// implementation of wxControlWithItems
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual void Delete(int n);
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual void Clear();
|
||||
virtual int GetSelection() const ;
|
||||
virtual void SetSelection(int n);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual wxString GetString(int n) const ;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual wxString GetString(unsigned int n) const ;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
// Text field functions
|
||||
virtual wxString GetValue() const ;
|
||||
|
@ -66,22 +66,22 @@ public:
|
||||
~wxListBox();
|
||||
|
||||
// implementation of wxControlWithItems
|
||||
virtual size_t GetCount() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
virtual int GetSelection() const;
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual void Clear();
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
|
||||
// implementation of wxListBoxbase
|
||||
virtual void DoSetSelection(int n, bool select);
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
virtual void DoSetFirstItem(int n);
|
||||
virtual int GetSelections(wxArrayInt& aSelections) const;
|
||||
@ -101,7 +101,7 @@ public:
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
size_t m_noItems;
|
||||
unsigned int m_noItems;
|
||||
|
||||
// List mapping positions->client data
|
||||
wxClientDataDictionary m_clientDataDict;
|
||||
|
@ -72,19 +72,19 @@ public:
|
||||
const wxValidator& val = wxDefaultValidator,
|
||||
const wxString& name = wxRadioBoxNameStr);
|
||||
|
||||
void SetSelection(int N);
|
||||
virtual void SetSelection(int n);
|
||||
int GetSelection() const;
|
||||
|
||||
void SetString(int item, const wxString& label) ;
|
||||
wxString GetString(int item) const;
|
||||
virtual void SetString(unsigned int item, const wxString& label);
|
||||
virtual wxString GetString(unsigned int item) const;
|
||||
virtual bool Enable(bool enable = true);
|
||||
virtual bool Enable(int item, bool enable = true);
|
||||
virtual bool Show(int item, bool show = true);
|
||||
virtual bool Enable(unsigned int item, bool enable = true);
|
||||
virtual bool Show(unsigned int item, bool show = true);
|
||||
virtual bool Show(bool show = true);
|
||||
|
||||
virtual wxString GetStringSelection() const;
|
||||
virtual bool SetStringSelection(const wxString& s);
|
||||
virtual size_t GetCount() const { return m_noItems; } ;
|
||||
virtual unsigned int GetCount() const { return m_noItems; } ;
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
||||
@ -103,7 +103,7 @@ protected:
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
size_t m_noItems;
|
||||
unsigned int m_noItems;
|
||||
int m_noRowsOrCols;
|
||||
int m_selectedButton;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: checklst.h
|
||||
// Name: wx/msw/checklst.h
|
||||
// Purpose: wxCheckListBox class - a listbox with checkable items
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
@ -56,13 +56,13 @@ public:
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
// override base class virtuals
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
|
||||
// items may be checked
|
||||
virtual bool IsChecked(size_t uiIndex) const;
|
||||
virtual void Check(size_t uiIndex, bool bCheck = true);
|
||||
virtual bool IsChecked(unsigned int uiIndex) const;
|
||||
virtual void Check(unsigned int uiIndex, bool bCheck = true);
|
||||
|
||||
// return the index of the item at this position or wxNOT_FOUND
|
||||
int HitTest(const wxPoint& pt) const { return DoHitTestItem(pt.x, pt.y); }
|
||||
|
@ -66,17 +66,17 @@ public:
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxChoiceNameStr);
|
||||
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual void Clear();
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual int GetSelection() const;
|
||||
virtual int GetCurrentSelection() const;
|
||||
virtual void SetSelection(int n);
|
||||
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
// MSW only
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
@ -90,12 +90,12 @@ protected:
|
||||
void Init() { m_lastAcceptedSelection = wxID_NONE; }
|
||||
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
virtual void DoSetItemClientData( int n, void* clientData );
|
||||
virtual void* DoGetItemClientData( int n ) const;
|
||||
virtual void DoSetItemClientObject( int n, wxClientData* clientData );
|
||||
virtual wxClientData* DoGetItemClientObject( int n ) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
// MSW implementation
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
@ -79,11 +79,11 @@ public:
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Clear();
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
|
||||
virtual bool IsSelected(int n) const;
|
||||
@ -135,19 +135,19 @@ public:
|
||||
protected:
|
||||
virtual void DoSetSelection(int n, bool select);
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
virtual void DoSetFirstItem(int n);
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
virtual int DoListHitTest(const wxPoint& point) const;
|
||||
|
||||
// free memory (common part of Clear() and dtor)
|
||||
void Free();
|
||||
|
||||
size_t m_noItems;
|
||||
unsigned int m_noItems;
|
||||
int m_selected;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
@ -85,13 +85,13 @@ public:
|
||||
// implement the radiobox interface
|
||||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const { return m_selectedButton; }
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& label);
|
||||
virtual bool Enable(int n, bool enable = true);
|
||||
virtual bool Show(int n, bool show = true);
|
||||
virtual bool IsItemEnabled(int n) const;
|
||||
virtual bool IsItemShown(int n) const;
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& label);
|
||||
virtual bool Enable(unsigned int n, bool enable = true);
|
||||
virtual bool Show(unsigned int n, bool show = true);
|
||||
virtual bool IsItemEnabled(unsigned int n) const;
|
||||
virtual bool IsItemShown(unsigned int n) const;
|
||||
|
||||
// override some base class methods
|
||||
virtual bool Show(bool show = true);
|
||||
|
@ -50,20 +50,20 @@ public:
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
// override base class virtuals
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
// items may be checked
|
||||
virtual bool IsChecked(size_t uiIndex) const;
|
||||
virtual void Check(size_t uiIndex, bool bCheck = true);
|
||||
virtual bool IsChecked(unsigned int uiIndex) const;
|
||||
virtual void Check(unsigned int uiIndex, bool bCheck = true);
|
||||
|
||||
// public interface derived from wxListBox and lower classes
|
||||
virtual void Clear();
|
||||
virtual size_t GetCount() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual int GetSelection() const;
|
||||
virtual int GetSelections(wxArrayInt& aSelections) const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual bool IsSelected(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
// Implementation
|
||||
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
||||
@ -73,12 +73,12 @@ protected:
|
||||
|
||||
// protected interface derived from wxListBox and lower classes
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetFirstItem(int n);
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
virtual void DoSetSelection(int n, bool select);
|
||||
// convert our styles to Windows
|
||||
|
@ -79,17 +79,17 @@ public:
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual void Delete(int n);
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual void Clear() ;
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual int GetSelection() const;
|
||||
virtual void SetSelection(int n);
|
||||
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
// get the subclassed window proc of the buddy list of choices
|
||||
WXFARPROC GetBuddyWndProc() const { return m_wndProcBuddy; }
|
||||
@ -100,10 +100,10 @@ public:
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
|
||||
protected:
|
||||
virtual void DoSetItemClientData( int n, void* clientData );
|
||||
virtual void* DoGetItemClientData( int n ) const;
|
||||
virtual void DoSetItemClientObject( int n, wxClientData* clientData );
|
||||
virtual wxClientData* DoGetItemClientObject( int n ) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
// MSW implementation
|
||||
virtual void DoGetPosition(int *x, int *y) const;
|
||||
|
@ -49,17 +49,15 @@ public:
|
||||
//
|
||||
// Override base class virtuals
|
||||
//
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
virtual bool SetFont(const wxFont &rFont);
|
||||
|
||||
//
|
||||
// Items may be checked
|
||||
//
|
||||
bool IsChecked(size_t uiIndex) const;
|
||||
void Check( size_t uiIndex
|
||||
,bool bCheck = true
|
||||
);
|
||||
bool IsChecked(unsigned int uiIndex) const;
|
||||
void Check(unsigned int uiIndex, bool bCheck = true);
|
||||
|
||||
//
|
||||
// Accessors
|
||||
@ -74,7 +72,7 @@ protected:
|
||||
virtual wxOwnerDrawn* CreateItem(size_t n);
|
||||
virtual long OS2OnMeasure(WXMEASUREITEMSTRUCT* pItem);
|
||||
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
|
||||
//
|
||||
// Pressing space or clicking the check box toggles the item
|
||||
@ -83,7 +81,7 @@ protected:
|
||||
void OnLeftClick(wxMouseEvent& rEvent);
|
||||
|
||||
private:
|
||||
size_t m_nItemHeight; // height of checklistbox items (the same for all)
|
||||
size_t m_nItemHeight; // height of checklistbox items (the same for all)
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxCheckListBox)
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
@ -90,18 +90,16 @@ public:
|
||||
// Implement base class virtuals
|
||||
//
|
||||
virtual int DoAppend(const wxString& rsItem);
|
||||
virtual int DoInsert(const wxString& rsItem, int pos);
|
||||
virtual void Delete(int n);
|
||||
virtual int DoInsert(const wxString& rsItem, unsigned int pos);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual void Clear(void);
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual int GetSelection(void) const ;
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual int GetSelection(void) const;
|
||||
virtual void SetSelection(int n);
|
||||
|
||||
virtual wxString GetString(int n) const ;
|
||||
virtual void SetString( int n
|
||||
,const wxString& rsStr
|
||||
);
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& rsStr);
|
||||
|
||||
//
|
||||
// OS2 only
|
||||
@ -115,14 +113,10 @@ public:
|
||||
);
|
||||
|
||||
protected:
|
||||
virtual void DoSetItemClientData( int n
|
||||
,void* pClientData
|
||||
);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject( int n
|
||||
,wxClientData* pClientData
|
||||
);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* pClientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* pClientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
virtual wxSize DoGetBestSize(void) const;
|
||||
virtual void DoSetSize( int nX
|
||||
,int nY
|
||||
|
@ -104,11 +104,11 @@ public:
|
||||
// Implement base class pure virtuals
|
||||
//
|
||||
virtual void Clear(void);
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& rsString);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& rsString);
|
||||
|
||||
virtual bool IsSelected(int n) const;
|
||||
virtual void DoSetSelection(int n, bool bSelect);
|
||||
@ -116,21 +116,17 @@ public:
|
||||
virtual int GetSelections(wxArrayInt& raSelections) const;
|
||||
|
||||
virtual int DoAppend(const wxString& rsItem);
|
||||
virtual void DoInsertItems( const wxArrayString& raItems, int rPos );
|
||||
virtual void DoInsertItems( const wxArrayString& raItems, unsigned int rPos );
|
||||
virtual void DoSetItems( const wxArrayString& raItems
|
||||
,void ** ppClientData
|
||||
);
|
||||
|
||||
virtual void DoSetFirstItem(int n);
|
||||
|
||||
virtual void DoSetItemClientData( int n
|
||||
,void* pClientData
|
||||
);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject( int n
|
||||
,wxClientData* pClientData
|
||||
);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* pClientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* pClientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
//
|
||||
// wxCheckListBox support
|
||||
@ -154,8 +150,8 @@ protected:
|
||||
bool HasMultipleSelection(void) const;
|
||||
virtual wxSize DoGetBestSize(void) const;
|
||||
|
||||
size_t m_nNumItems;
|
||||
int m_nSelected;
|
||||
unsigned int m_nNumItems;
|
||||
int m_nSelected;
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
//
|
||||
|
@ -102,7 +102,7 @@ public:
|
||||
void Command(wxCommandEvent& rEvent);
|
||||
bool ContainsHWND(WXHWND hWnd) const;
|
||||
virtual bool Enable(bool bEnable = true);
|
||||
virtual bool Enable(int nItem, bool bEnable = true);
|
||||
virtual bool Enable(unsigned int nItem, bool bEnable = true);
|
||||
|
||||
virtual WXHBRUSH OnCtlColor( WXHDC hDC
|
||||
,WXHWND hWnd
|
||||
@ -115,7 +115,7 @@ public:
|
||||
,WXWORD wId
|
||||
);
|
||||
void SendNotificationEvent(void);
|
||||
virtual bool Show(int nItem, bool bShow = true);
|
||||
virtual bool Show(unsigned int nItem, bool bShow = true);
|
||||
virtual bool Show(bool bShow = true);
|
||||
MRESULT WindowProc( WXUINT uMsg
|
||||
,WXWPARAM wParam
|
||||
@ -125,24 +125,20 @@ public:
|
||||
|
||||
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
inline WXHWND* GetRadioButtons(void) const { return m_ahRadioButtons; }
|
||||
int GetSelection(void) const;
|
||||
void GetSize( int* pnX
|
||||
,int* pnY
|
||||
) const;
|
||||
void GetSize(int* pnX, int* pnY) const;
|
||||
inline int GetSizeFlags(void) const { return m_nSizeFlags; }
|
||||
wxString GetString(int nIndex) const;
|
||||
virtual wxString GetString(unsigned int nIndex) const;
|
||||
virtual wxString GetStringSelection(void) const;
|
||||
|
||||
inline void SetButtonFont(const wxFont& rFont) { SetFont(rFont); }
|
||||
void SetFocus(void);
|
||||
virtual bool SetFont(const wxFont& rFont);
|
||||
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
||||
void SetSelection(int nIndex);
|
||||
virtual void SetString( int nNum
|
||||
,const wxString& rsLabel
|
||||
);
|
||||
virtual void SetSelection(int nIndex);
|
||||
virtual void SetString(unsigned int nNum, const wxString& rsLabel);
|
||||
virtual bool SetStringSelection(const wxString& rsStr);
|
||||
|
||||
virtual void SetLabel(const wxString& rsLabel)
|
||||
@ -175,7 +171,7 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
size_t m_nNoItems;
|
||||
unsigned int m_nNoItems;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||
}; // end of wxRadioBox
|
||||
|
@ -56,13 +56,13 @@ public:
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
// override base class virtuals
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
|
||||
// items may be checked
|
||||
virtual bool IsChecked(size_t uiIndex) const;
|
||||
virtual void Check(size_t uiIndex, bool bCheck = TRUE);
|
||||
virtual bool IsChecked(unsigned int uiIndex) const;
|
||||
virtual void Check(unsigned int uiIndex, bool bCheck = true);
|
||||
|
||||
// return the index of the item at this position or wxNOT_FOUND
|
||||
int HitTest(const wxPoint& pt) const { return DoHitTestItem(pt.x, pt.y); }
|
||||
@ -85,7 +85,7 @@ protected:
|
||||
void OnLeftClick(wxMouseEvent& event);
|
||||
|
||||
private:
|
||||
size_t m_nItemHeight; // height of checklistbox items (the same for all)
|
||||
size_t m_nItemHeight; // height of checklistbox items (the same for all)
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckListBox)
|
||||
|
@ -65,16 +65,16 @@ public:
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual void Delete(int n);
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual void Clear();
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual int GetSelection() const;
|
||||
virtual void SetSelection(int n);
|
||||
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
// MSW only
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
@ -82,10 +82,10 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
virtual void DoSetItemClientData( int n, void* clientData );
|
||||
virtual void* DoGetItemClientData( int n ) const;
|
||||
virtual void DoSetItemClientObject( int n, wxClientData* clientData );
|
||||
virtual wxClientData* DoGetItemClientObject( int n ) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
// MSW implementation
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
@ -79,11 +79,11 @@ public:
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Clear();
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
virtual bool IsSelected(int n) const;
|
||||
virtual void DoSetSelection(int n, bool select);
|
||||
@ -91,15 +91,15 @@ public:
|
||||
virtual int GetSelections(wxArrayInt& aSelections) const;
|
||||
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
|
||||
virtual void DoSetFirstItem(int n);
|
||||
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
// wxCheckListBox support
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
|
@ -88,15 +88,15 @@ public:
|
||||
// implement the radiobox interface
|
||||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const;
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& label);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& label);
|
||||
|
||||
virtual bool Enable(bool enable = true);
|
||||
virtual bool Enable(int n, bool enable = true);
|
||||
virtual bool Enable(unsigned int n, bool enable = true);
|
||||
|
||||
virtual bool Show(bool show = true);
|
||||
virtual bool Show(int n, bool show = true);
|
||||
virtual bool Show(unsigned int n, bool show = true);
|
||||
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual wxString GetLabel();
|
||||
|
@ -28,17 +28,17 @@ class WXDLLEXPORT wxRadioBoxBase : public wxItemContainerImmutable
|
||||
{
|
||||
public:
|
||||
// change/query the individual radio button state
|
||||
virtual bool Enable(int n, bool enable = true) = 0;
|
||||
virtual bool Show(int n, bool show = true) = 0;
|
||||
virtual bool Enable(unsigned int n, bool enable = true) = 0;
|
||||
virtual bool Show(unsigned int n, bool show = true) = 0;
|
||||
|
||||
// NB: these functions are stubbed here for now but should become pure
|
||||
// virtual once all ports implement them
|
||||
virtual bool IsItemEnabled(int WXUNUSED(n)) const { return true; }
|
||||
virtual bool IsItemShown(int WXUNUSED(n)) const { return true; }
|
||||
virtual bool IsItemEnabled(unsigned int WXUNUSED(n)) const { return true; }
|
||||
virtual bool IsItemShown(unsigned int WXUNUSED(n)) const { return true; }
|
||||
|
||||
// return number of columns/rows in this radiobox
|
||||
int GetColumnCount() const { return m_numCols; }
|
||||
int GetRowCount() const { return m_numRows; }
|
||||
unsigned int GetColumnCount() const { return m_numCols; }
|
||||
unsigned int GetRowCount() const { return m_numRows; }
|
||||
|
||||
// return the item above/below/to the left/right of the given one
|
||||
int GetNextItem(int item, wxDirection dir, long style) const;
|
||||
@ -60,21 +60,21 @@ protected:
|
||||
|
||||
// return the number of items in major direction (which depends on whether
|
||||
// we have wxRA_SPECIFY_COLS or wxRA_SPECIFY_ROWS style)
|
||||
int GetMajorDim() const { return m_majorDim; }
|
||||
unsigned int GetMajorDim() const { return m_majorDim; }
|
||||
|
||||
// sets m_majorDim and also updates m_numCols/Rows
|
||||
//
|
||||
// the style parameter should be the style of the radiobox itself
|
||||
void SetMajorDim(int majorDim, long style);
|
||||
void SetMajorDim(unsigned int majorDim, long style);
|
||||
|
||||
|
||||
private:
|
||||
// the number of elements in major dimension (i.e. number of columns if
|
||||
// wxRA_SPECIFY_COLS or the number of rows if wxRA_SPECIFY_ROWS) and also
|
||||
// the number of rows/columns calculated from it
|
||||
int m_majorDim,
|
||||
m_numCols,
|
||||
m_numRows;
|
||||
unsigned int m_majorDim,
|
||||
m_numCols,
|
||||
m_numRows;
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
|
@ -70,8 +70,8 @@ public:
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
// implement check list box methods
|
||||
virtual bool IsChecked(size_t item) const;
|
||||
virtual void Check(size_t item, bool check = true);
|
||||
virtual bool IsChecked(unsigned int item) const;
|
||||
virtual void Check(unsigned int item, bool check = true);
|
||||
|
||||
// and input handling
|
||||
virtual bool PerformAction(const wxControlAction& action,
|
||||
@ -80,11 +80,11 @@ public:
|
||||
|
||||
// override all methods which add/delete items to update m_checks array as
|
||||
// well
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
protected:
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
virtual void DoClear();
|
||||
|
||||
@ -122,4 +122,3 @@ public:
|
||||
};
|
||||
|
||||
#endif // _WX_UNIV_CHECKLST_H_
|
||||
|
||||
|
@ -293,10 +293,10 @@ public:
|
||||
|
||||
// wxControlWithItems methods
|
||||
virtual void Clear();
|
||||
virtual void Delete(int n);
|
||||
virtual size_t GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual void Delete(unsigned int n);
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const;
|
||||
@ -305,11 +305,11 @@ public:
|
||||
|
||||
protected:
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual int DoInsert(const wxString& item, unsigned int pos);
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
@ -97,13 +97,13 @@ public:
|
||||
|
||||
// implement the listbox interface defined by wxListBoxBase
|
||||
virtual void Clear();
|
||||
virtual void Delete(int n);
|
||||
virtual void Delete(unsigned int n);
|
||||
|
||||
virtual size_t GetCount() const
|
||||
{ return m_strings->GetCount(); }
|
||||
virtual wxString GetString(int n) const
|
||||
virtual unsigned int GetCount() const
|
||||
{ return (unsigned int)m_strings->GetCount(); }
|
||||
virtual wxString GetString(unsigned int n) const
|
||||
{ return m_strings->Item(n); }
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const
|
||||
{ return m_strings->Index(s, bCase); }
|
||||
|
||||
@ -116,15 +116,15 @@ protected:
|
||||
virtual void DoSetSelection(int n, bool select);
|
||||
virtual int DoAppendOnly(const wxString& item);
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
||||
virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
||||
|
||||
virtual void DoSetFirstItem(int n);
|
||||
|
||||
virtual void DoSetItemClientData(int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(int n) const;
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
|
||||
|
||||
public:
|
||||
// override some more base class methods
|
||||
|
@ -84,16 +84,17 @@ public:
|
||||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const;
|
||||
|
||||
virtual size_t GetCount() const { return m_buttons.GetCount(); }
|
||||
virtual unsigned int GetCount() const
|
||||
{ return (unsigned int)m_buttons.GetCount(); }
|
||||
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& label);
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& label);
|
||||
|
||||
virtual bool Enable(int n, bool enable = true);
|
||||
virtual bool Show(int n, bool show = true);
|
||||
virtual bool Enable(unsigned int n, bool enable = true);
|
||||
virtual bool Show(unsigned int n, bool show = true);
|
||||
|
||||
virtual bool IsItemEnabled(int n) const;
|
||||
virtual bool IsItemShown(int n) const;
|
||||
virtual bool IsItemEnabled(unsigned int n) const;
|
||||
virtual bool IsItemShown(unsigned int n) const;
|
||||
|
||||
// we also override the wxControl methods to avoid virtual function hiding
|
||||
virtual bool Enable(bool enable = true);
|
||||
|
@ -362,8 +362,8 @@ void ComboboxWidgetsPage::CreateCombo()
|
||||
wxArrayString items;
|
||||
if ( m_combobox )
|
||||
{
|
||||
int count = m_combobox->GetCount();
|
||||
for ( int n = 0; n < count; n++ )
|
||||
unsigned int count = m_combobox->GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
items.Add(m_combobox->GetString(n));
|
||||
}
|
||||
@ -377,8 +377,8 @@ void ComboboxWidgetsPage::CreateCombo()
|
||||
0, NULL,
|
||||
flags);
|
||||
|
||||
size_t count = items.GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = items.GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
m_combobox->Append(items[n]);
|
||||
}
|
||||
@ -415,7 +415,7 @@ void ComboboxWidgetsPage::OnButtonDelete(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
unsigned long n;
|
||||
if ( !m_textDelete->GetValue().ToULong(&n) ||
|
||||
(n >= (unsigned)m_combobox->GetCount()) )
|
||||
(n >= m_combobox->GetCount()) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -426,7 +426,7 @@ void ComboboxWidgetsPage::OnButtonDelete(wxCommandEvent& WXUNUSED(event))
|
||||
void ComboboxWidgetsPage::OnButtonDeleteSel(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
int sel = m_combobox->GetSelection();
|
||||
if ( sel != -1 )
|
||||
if ( sel != wxNOT_FOUND )
|
||||
{
|
||||
m_combobox->Delete(sel);
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: cocoa/checklst.mm
|
||||
// Name: src/cocoa/checklst.mm
|
||||
// Purpose: wxCheckListBox
|
||||
// Author: David Elliott
|
||||
// Modified by:
|
||||
// Created: 2003/03/18
|
||||
// RCS-ID: $Id:
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2003 David Elliott
|
||||
// Licence: wxWidgets licence
|
||||
// Licence: wxWidgets licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
@ -58,13 +58,13 @@ wxCheckListBox::~wxCheckListBox()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxCheckListBox::IsChecked(size_t item) const
|
||||
bool wxCheckListBox::IsChecked(unsigned int item) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void wxCheckListBox::Check(size_t item, bool check)
|
||||
void wxCheckListBox::Check(unsigned int item, bool check)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID winid,
|
||||
{
|
||||
m_sortedStrings->Add(choices[i]);
|
||||
}
|
||||
for(size_t i=0; i < m_sortedStrings->GetCount(); i++)
|
||||
for(unsigned int i=0; i < m_sortedStrings->GetCount(); i++)
|
||||
{
|
||||
[nsmenu addItemWithTitle:wxNSStringWithWxString(
|
||||
m_sortedStrings->Item(i))
|
||||
@ -113,7 +113,7 @@ wxChoice::~wxChoice()
|
||||
|
||||
if(HasClientObjectData())
|
||||
{
|
||||
for(size_t i=0; i < m_itemsClientData.GetCount(); i++)
|
||||
for(unsigned int i=0; i < m_itemsClientData.GetCount(); i++)
|
||||
delete (wxClientData*)m_itemsClientData.Item(i);
|
||||
}
|
||||
m_itemsClientData.Clear();
|
||||
@ -139,14 +139,14 @@ void wxChoice::Clear()
|
||||
m_sortedStrings->Clear();
|
||||
if(HasClientObjectData())
|
||||
{
|
||||
for(size_t i=0; i < m_itemsClientData.GetCount(); i++)
|
||||
for(unsigned int i=0; i < m_itemsClientData.GetCount(); i++)
|
||||
delete (wxClientData*)m_itemsClientData.Item(i);
|
||||
}
|
||||
m_itemsClientData.Clear();
|
||||
[(NSPopUpButton*)m_cocoaNSView removeAllItems];
|
||||
}
|
||||
|
||||
void wxChoice::Delete(int n)
|
||||
void wxChoice::Delete(unsigned int n)
|
||||
{
|
||||
if(m_sortedStrings)
|
||||
m_sortedStrings->RemoveAt(n);
|
||||
@ -156,18 +156,18 @@ void wxChoice::Delete(int n)
|
||||
[(NSPopUpButton*)m_cocoaNSView removeItemAtIndex:n];
|
||||
}
|
||||
|
||||
size_t wxChoice::GetCount() const
|
||||
unsigned int wxChoice::GetCount() const
|
||||
{
|
||||
return (size_t)[(NSPopUpButton*)m_cocoaNSView numberOfItems];
|
||||
return (unsigned int)[(NSPopUpButton*)m_cocoaNSView numberOfItems];
|
||||
}
|
||||
|
||||
wxString wxChoice::GetString(int n) const
|
||||
wxString wxChoice::GetString(unsigned int n) const
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
return wxStringWithNSString([(NSPopUpButton*)m_cocoaNSView itemTitleAtIndex:n]);
|
||||
}
|
||||
|
||||
void wxChoice::SetString(int n, const wxString& title)
|
||||
void wxChoice::SetString(unsigned int n, const wxString& title)
|
||||
{
|
||||
NSMenuItem *item = [(NSPopUpButton*)m_cocoaNSView itemAtIndex:n];
|
||||
[item setTitle:wxNSStringWithWxString(title)];
|
||||
@ -207,7 +207,7 @@ int wxChoice::DoAppend(const wxString& title)
|
||||
return [nsmenu indexOfItem:item];
|
||||
}
|
||||
|
||||
int wxChoice::DoInsert(const wxString& title, int pos)
|
||||
int wxChoice::DoInsert(const wxString& title, unsigned int pos)
|
||||
{
|
||||
if(m_sortedStrings)
|
||||
return DoAppend(title);
|
||||
@ -218,22 +218,22 @@ int wxChoice::DoInsert(const wxString& title, int pos)
|
||||
return [nsmenu indexOfItem:item];
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientData(int n, void *data)
|
||||
void wxChoice::DoSetItemClientData(unsigned int n, void *data)
|
||||
{
|
||||
m_itemsClientData.Item(n) = data;
|
||||
}
|
||||
|
||||
void* wxChoice::DoGetItemClientData(int n) const
|
||||
void* wxChoice::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
return m_itemsClientData.Item(n);
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject(int n, wxClientData *data)
|
||||
void wxChoice::DoSetItemClientObject(unsigned int n, wxClientData *data)
|
||||
{
|
||||
m_itemsClientData.Item(n) = data;
|
||||
}
|
||||
|
||||
wxClientData* wxChoice::DoGetItemClientObject(int n) const
|
||||
wxClientData* wxChoice::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return (wxClientData*)m_itemsClientData.Item(n);
|
||||
}
|
||||
|
@ -255,23 +255,23 @@ void wxComboBox::Clear()
|
||||
m_Datas.Clear();
|
||||
}
|
||||
|
||||
void wxComboBox::Delete(int nIndex)
|
||||
void wxComboBox::Delete(unsigned int n)
|
||||
{
|
||||
[GetNSComboBox() removeItemAtIndex:nIndex];
|
||||
m_Datas.RemoveAt(nIndex);
|
||||
[GetNSComboBox() removeItemAtIndex:n];
|
||||
m_Datas.RemoveAt(n);
|
||||
}
|
||||
|
||||
size_t wxComboBox::GetCount() const
|
||||
unsigned int wxComboBox::GetCount() const
|
||||
{
|
||||
return (size_t)[GetNSComboBox() numberOfItems];
|
||||
return (unsigned int)[GetNSComboBox() numberOfItems];
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetString(int nIndex) const
|
||||
wxString wxComboBox::GetString(unsigned int nIndex) const
|
||||
{
|
||||
return wxStringWithNSString([GetNSComboBox() itemObjectValueAtIndex:nIndex]);
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(int nIndex, const wxString& szString)
|
||||
void wxComboBox::SetString(unsigned int nIndex, const wxString& szString)
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
//FIXME: There appears to be no "set item data" method - maybe
|
||||
@ -299,30 +299,30 @@ int wxComboBox::DoAppend(const wxString& szItem)
|
||||
return [GetNSComboBox() numberOfItems];
|
||||
}
|
||||
|
||||
int wxComboBox::DoInsert(const wxString& szItem, int nIndex)
|
||||
int wxComboBox::DoInsert(const wxString& szItem, unsigned int nIndex)
|
||||
{
|
||||
m_Datas.Insert(NULL, nIndex);
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
[GetNSComboBox() insertItemWithObjectValue:wxNSStringWithWxString(szItem) atIndex:nIndex];
|
||||
return nIndex;
|
||||
return (int)nIndex;
|
||||
}
|
||||
|
||||
void wxComboBox::DoSetItemClientData(int nIndex, void* pData)
|
||||
void wxComboBox::DoSetItemClientData(unsigned int nIndex, void* pData)
|
||||
{
|
||||
m_Datas[nIndex] = pData;
|
||||
}
|
||||
|
||||
void* wxComboBox::DoGetItemClientData(int nIndex) const
|
||||
void* wxComboBox::DoGetItemClientData(unsigned int nIndex) const
|
||||
{
|
||||
return m_Datas[nIndex];
|
||||
}
|
||||
|
||||
void wxComboBox::DoSetItemClientObject(int nIndex, wxClientData* pClientData)
|
||||
void wxComboBox::DoSetItemClientObject(unsigned int nIndex, wxClientData* pClientData)
|
||||
{
|
||||
m_Datas[nIndex] = (void*) pClientData;
|
||||
}
|
||||
|
||||
wxClientData* wxComboBox::DoGetItemClientObject(int nIndex) const
|
||||
wxClientData* wxComboBox::DoGetItemClientObject(unsigned int nIndex) const
|
||||
{
|
||||
return (wxClientData*) m_Datas[nIndex];
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ int wxListBox::GetSelections(wxArrayInt& aSelections) const
|
||||
return [GetNSTableView() numberOfSelectedRows];
|
||||
}
|
||||
|
||||
void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
void wxListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
|
||||
@ -189,7 +189,7 @@ void wxListBox::DoSetItems(const wxArrayString& items, void **clientData)
|
||||
[m_cocoaItems removeAllObjects];
|
||||
m_itemClientData.Clear();
|
||||
// Provide the data
|
||||
for(size_t i=0; i < items.GetCount(); i++)
|
||||
for(unsigned int i=0; i < items.GetCount(); i++)
|
||||
{
|
||||
[m_cocoaItems addObject: wxNSStringWithWxString(items[i])];
|
||||
m_itemClientData.Add(clientData[i]);
|
||||
@ -216,7 +216,7 @@ void wxListBox::Clear()
|
||||
[GetNSTableView() reloadData];
|
||||
}
|
||||
|
||||
void wxListBox::Delete(int n)
|
||||
void wxListBox::Delete(unsigned int n)
|
||||
{
|
||||
[m_cocoaItems removeObjectAtIndex:n];
|
||||
m_itemClientData.RemoveAt(n);
|
||||
@ -224,17 +224,17 @@ void wxListBox::Delete(int n)
|
||||
}
|
||||
|
||||
// accessing strings
|
||||
size_t wxListBox::GetCount() const
|
||||
unsigned int wxListBox::GetCount() const
|
||||
{
|
||||
return (size_t)[m_cocoaItems count];
|
||||
return (unsigned int)[m_cocoaItems count];
|
||||
}
|
||||
|
||||
wxString wxListBox::GetString(int n) const
|
||||
wxString wxListBox::GetString(unsigned int n) const
|
||||
{
|
||||
return wxStringWithNSString([m_cocoaItems objectAtIndex:n]);
|
||||
}
|
||||
|
||||
void wxListBox::SetString(int n, const wxString& s)
|
||||
void wxListBox::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
[m_cocoaItems removeObjectAtIndex:n];
|
||||
@ -264,22 +264,22 @@ int wxListBox::DoAppend(const wxString& item)
|
||||
return [m_cocoaItems count];
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientData(int n, void* clientData)
|
||||
void wxListBox::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
m_itemClientData[n] = clientData;
|
||||
}
|
||||
|
||||
void* wxListBox::DoGetItemClientData(int n) const
|
||||
void* wxListBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
return m_itemClientData[n];
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||
void wxListBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
m_itemClientData[n] = (void*) clientData;
|
||||
}
|
||||
|
||||
wxClientData* wxListBox::DoGetItemClientObject(int n) const
|
||||
wxClientData* wxListBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return (wxClientData*) m_itemClientData[n];
|
||||
}
|
||||
|
@ -76,28 +76,28 @@ int wxRadioBox::GetSelection() const
|
||||
}
|
||||
|
||||
// string access
|
||||
size_t wxRadioBox::GetCount() const
|
||||
unsigned int wxRadioBox::GetCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxString wxRadioBox::GetString(int n) const
|
||||
wxString wxRadioBox::GetString(unsigned int n) const
|
||||
{
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
void wxRadioBox::SetString(int n, const wxString& label)
|
||||
void wxRadioBox::SetString(unsigned int n, const wxString& label)
|
||||
{
|
||||
}
|
||||
|
||||
// change the individual radio button state
|
||||
bool wxRadioBox::Enable(int n, bool enable)
|
||||
bool wxRadioBox::Enable(unsigned int n, bool enable)
|
||||
{
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxRadioBox::Show(int n, bool show)
|
||||
bool wxRadioBox::Show(unsigned int n, bool show)
|
||||
{
|
||||
// TODO
|
||||
return false;
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: common/ctrlsub.cpp
|
||||
// Name: src/common/ctrlsub.cpp
|
||||
// Purpose: wxItemContainer implementation
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
@ -49,9 +49,10 @@ wxItemContainerImmutable::~wxItemContainerImmutable()
|
||||
wxString wxItemContainerImmutable::GetStringSelection() const
|
||||
{
|
||||
wxString s;
|
||||
|
||||
int sel = GetSelection();
|
||||
if ( sel != -1 )
|
||||
s = GetString(sel);
|
||||
if ( sel != wxNOT_FOUND )
|
||||
s = GetString((unsigned int)sel);
|
||||
|
||||
return s;
|
||||
}
|
||||
@ -71,9 +72,9 @@ wxArrayString wxItemContainerImmutable::GetStrings() const
|
||||
{
|
||||
wxArrayString result;
|
||||
|
||||
const size_t count = GetCount();
|
||||
const unsigned int count = GetCount();
|
||||
result.Alloc(count);
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
result.Add(GetString(n));
|
||||
|
||||
return result;
|
||||
@ -94,14 +95,14 @@ wxItemContainer::~wxItemContainer()
|
||||
|
||||
void wxItemContainer::Append(const wxArrayString& strings)
|
||||
{
|
||||
size_t count = strings.GetCount();
|
||||
const size_t count = strings.GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
{
|
||||
Append(strings[n]);
|
||||
}
|
||||
}
|
||||
|
||||
int wxItemContainer::Insert(const wxString& item, int pos, void *clientData)
|
||||
int wxItemContainer::Insert(const wxString& item, unsigned int pos, void *clientData)
|
||||
{
|
||||
int n = DoInsert(item, pos);
|
||||
if ( n != wxNOT_FOUND )
|
||||
@ -110,8 +111,7 @@ int wxItemContainer::Insert(const wxString& item, int pos, void *clientData)
|
||||
return n;
|
||||
}
|
||||
|
||||
int
|
||||
wxItemContainer::Insert(const wxString& item, int pos, wxClientData *clientData)
|
||||
int wxItemContainer::Insert(const wxString& item, unsigned int pos, wxClientData *clientData)
|
||||
{
|
||||
int n = DoInsert(item, pos);
|
||||
if ( n != wxNOT_FOUND )
|
||||
@ -124,7 +124,7 @@ wxItemContainer::Insert(const wxString& item, int pos, wxClientData *clientData)
|
||||
// client data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxItemContainer::SetClientObject(int n, wxClientData *data)
|
||||
void wxItemContainer::SetClientObject(unsigned int n, wxClientData *data)
|
||||
{
|
||||
wxASSERT_MSG( m_clientDataItemsType != wxClientData_Void,
|
||||
wxT("can't have both object and void client data") );
|
||||
@ -147,7 +147,7 @@ void wxItemContainer::SetClientObject(int n, wxClientData *data)
|
||||
DoSetItemClientObject(n, data);
|
||||
}
|
||||
|
||||
wxClientData *wxItemContainer::GetClientObject(int n) const
|
||||
wxClientData *wxItemContainer::GetClientObject(unsigned int n) const
|
||||
{
|
||||
wxASSERT_MSG( m_clientDataItemsType == wxClientData_Object,
|
||||
wxT("this window doesn't have object client data") );
|
||||
@ -155,7 +155,7 @@ wxClientData *wxItemContainer::GetClientObject(int n) const
|
||||
return DoGetItemClientObject(n);
|
||||
}
|
||||
|
||||
void wxItemContainer::SetClientData(int n, void *data)
|
||||
void wxItemContainer::SetClientData(unsigned int n, void *data)
|
||||
{
|
||||
wxASSERT_MSG( m_clientDataItemsType != wxClientData_Object,
|
||||
wxT("can't have both object and void client data") );
|
||||
@ -164,7 +164,7 @@ void wxItemContainer::SetClientData(int n, void *data)
|
||||
m_clientDataItemsType = wxClientData_Void;
|
||||
}
|
||||
|
||||
void *wxItemContainer::GetClientData(int n) const
|
||||
void *wxItemContainer::GetClientData(unsigned int n) const
|
||||
{
|
||||
wxASSERT_MSG( m_clientDataItemsType == wxClientData_Void,
|
||||
wxT("this window doesn't have void client data") );
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: common/lboxcmn.cpp
|
||||
// Name: src/common/lboxcmn.cpp
|
||||
// Purpose: wxListBox class methods common to all platforms
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
@ -45,10 +45,10 @@ wxListBoxBase::~wxListBoxBase()
|
||||
// adding items
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxListBoxBase::InsertItems(int nItems, const wxString *items, int pos)
|
||||
void wxListBoxBase::InsertItems(unsigned int nItems, const wxString *items, unsigned int pos)
|
||||
{
|
||||
wxArrayString aItems;
|
||||
for ( int n = 0; n < nItems; n++ )
|
||||
for ( unsigned int n = 0; n < nItems; n++ )
|
||||
{
|
||||
aItems.Add(items[n]);
|
||||
}
|
||||
|
@ -34,7 +34,7 @@
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
void wxRadioBoxBase::SetMajorDim(int majorDim, long style)
|
||||
void wxRadioBoxBase::SetMajorDim(unsigned int majorDim, long style)
|
||||
{
|
||||
wxCHECK_RET( majorDim != 0, _T("major radiobox dimension can't be 0") );
|
||||
|
||||
|
@ -101,16 +101,16 @@ void wxCheckListBox::DoCreateCheckList()
|
||||
gtk_tree_view_append_column(m_treeview, column);
|
||||
}
|
||||
|
||||
bool wxCheckListBox::IsChecked( int index ) const
|
||||
bool wxCheckListBox::IsChecked(unsigned int index) const
|
||||
{
|
||||
wxCHECK_MSG( m_treeview != NULL, FALSE, wxT("invalid checklistbox") );
|
||||
wxCHECK_MSG( m_treeview != NULL, false, wxT("invalid checklistbox") );
|
||||
|
||||
GtkTreeIter iter;
|
||||
gboolean res = gtk_tree_model_iter_nth_child(
|
||||
GTK_TREE_MODEL(m_liststore),
|
||||
&iter, NULL, //NULL = parent = get first
|
||||
index
|
||||
);
|
||||
);
|
||||
if(!res)
|
||||
return false;
|
||||
|
||||
@ -123,7 +123,7 @@ bool wxCheckListBox::IsChecked( int index ) const
|
||||
return g_value_get_boolean(&value) == TRUE ? true : false;
|
||||
}
|
||||
|
||||
void wxCheckListBox::Check( int index, bool check )
|
||||
void wxCheckListBox::Check(unsigned int index, bool check)
|
||||
{
|
||||
wxCHECK_RET( m_treeview != NULL, wxT("invalid checklistbox") );
|
||||
|
||||
@ -132,7 +132,7 @@ void wxCheckListBox::Check( int index, bool check )
|
||||
GTK_TREE_MODEL(m_liststore),
|
||||
&iter, NULL, //NULL = parent = get first
|
||||
index
|
||||
);
|
||||
);
|
||||
if(!res)
|
||||
return;
|
||||
|
||||
|
@ -120,7 +120,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
|
||||
|
||||
GtkWidget *menu = gtk_menu_new();
|
||||
|
||||
for (size_t i = 0; i < (size_t)n; i++)
|
||||
for (unsigned int i = 0; i < (unsigned int)n; i++)
|
||||
{
|
||||
GtkAddHelper(menu, i, choices[i]);
|
||||
}
|
||||
@ -151,27 +151,27 @@ int wxChoice::DoAppend( const wxString &item )
|
||||
return GtkAddHelper(menu, GetCount(), item);
|
||||
}
|
||||
|
||||
int wxChoice::DoInsert( const wxString &item, int pos )
|
||||
int wxChoice::DoInsert(const wxString &item, unsigned int pos)
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid choice control") );
|
||||
wxCHECK_MSG( IsValidInsert(pos), -1, wxT("invalid index"));
|
||||
|
||||
if ((size_t)pos == GetCount())
|
||||
if (pos == GetCount())
|
||||
return DoAppend(item);
|
||||
|
||||
GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) );
|
||||
|
||||
// if the item to insert is at or before the selection, and the selection is valid
|
||||
if ((pos <= m_selection_hack) && (m_selection_hack != wxNOT_FOUND))
|
||||
if (((int)pos <= m_selection_hack) && (m_selection_hack != wxNOT_FOUND))
|
||||
{
|
||||
// move the selection forward one
|
||||
m_selection_hack++;
|
||||
}
|
||||
|
||||
return GtkAddHelper(menu, (size_t)pos, item);
|
||||
return GtkAddHelper(menu, pos, item);
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
void wxChoice::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") );
|
||||
|
||||
@ -181,7 +181,7 @@ void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
node->SetData( (wxObject*) clientData );
|
||||
}
|
||||
|
||||
void* wxChoice::DoGetItemClientData( int n ) const
|
||||
void* wxChoice::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid choice control") );
|
||||
|
||||
@ -191,7 +191,7 @@ void* wxChoice::DoGetItemClientData( int n ) const
|
||||
return node->GetData();
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
void wxChoice::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") );
|
||||
|
||||
@ -203,7 +203,7 @@ void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
node->SetData( (wxObject*) clientData );
|
||||
}
|
||||
|
||||
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
wxClientData* wxChoice::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid choice control") );
|
||||
|
||||
@ -243,23 +243,23 @@ void wxChoice::Clear()
|
||||
m_selection_hack = wxNOT_FOUND;
|
||||
}
|
||||
|
||||
void wxChoice::Delete( int n )
|
||||
void wxChoice::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid choice") );
|
||||
wxCHECK_RET( IsValid(n), _T("invalid index in wxChoice::Delete") );
|
||||
|
||||
// VZ: apparently GTK+ doesn't have a built-in function to do it (not even
|
||||
// in 2.0), hence this dumb implementation -- still better than nothing
|
||||
size_t i;
|
||||
const size_t count = GetCount();
|
||||
unsigned int i;
|
||||
const unsigned int count = GetCount();
|
||||
|
||||
// if the item to delete is before the selection, and the selection is valid
|
||||
if ((n < m_selection_hack) && (m_selection_hack != wxNOT_FOUND))
|
||||
if (((int)n < m_selection_hack) && (m_selection_hack != wxNOT_FOUND))
|
||||
{
|
||||
// move the selection back one
|
||||
m_selection_hack--;
|
||||
}
|
||||
else if (n == m_selection_hack)
|
||||
else if ((int)n == m_selection_hack)
|
||||
{
|
||||
// invalidate the selection
|
||||
m_selection_hack = wxNOT_FOUND;
|
||||
@ -275,7 +275,7 @@ void wxChoice::Delete( int n )
|
||||
items.Alloc(count);
|
||||
for ( i = 0; i < count; i++ )
|
||||
{
|
||||
if ( i != (size_t)n )
|
||||
if ( i != n )
|
||||
{
|
||||
items.Add(GetString(i));
|
||||
if ( hasClientData )
|
||||
@ -357,12 +357,12 @@ int wxChoice::GetSelection() const
|
||||
|
||||
}
|
||||
|
||||
void wxChoice::SetString( int n, const wxString& str )
|
||||
void wxChoice::SetString(unsigned int n, const wxString& str)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid choice") );
|
||||
|
||||
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
|
||||
int count = 0;
|
||||
unsigned int count = 0;
|
||||
GList *child = menu_shell->children;
|
||||
while (child)
|
||||
{
|
||||
@ -386,12 +386,12 @@ void wxChoice::SetString( int n, const wxString& str )
|
||||
}
|
||||
}
|
||||
|
||||
wxString wxChoice::GetString( int n ) const
|
||||
wxString wxChoice::GetString(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid choice") );
|
||||
|
||||
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
|
||||
int count = 0;
|
||||
unsigned int count = 0;
|
||||
GList *child = menu_shell->children;
|
||||
while (child)
|
||||
{
|
||||
@ -417,12 +417,12 @@ wxString wxChoice::GetString( int n ) const
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
size_t wxChoice::GetCount() const
|
||||
unsigned int wxChoice::GetCount() const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, 0, wxT("invalid choice") );
|
||||
|
||||
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
|
||||
size_t count = 0;
|
||||
unsigned int count = 0;
|
||||
GList *child = menu_shell->children;
|
||||
while (child)
|
||||
{
|
||||
@ -440,7 +440,7 @@ void wxChoice::SetSelection( int n )
|
||||
gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp );
|
||||
|
||||
// set the local selection variable manually
|
||||
if ((n >= 0) && (n < (int)GetCount()))
|
||||
if ((n >= 0) && ((unsigned int)n < GetCount()))
|
||||
{
|
||||
// a valid selection has been made
|
||||
m_selection_hack = n;
|
||||
@ -487,13 +487,13 @@ void wxChoice::DoApplyWidgetStyle(GtkRcStyle *style)
|
||||
#pragma message disable unscomzer
|
||||
#endif
|
||||
|
||||
int wxChoice::GtkAddHelper(GtkWidget *menu, size_t pos, const wxString& item)
|
||||
int wxChoice::GtkAddHelper(GtkWidget *menu, unsigned int pos, const wxString& item)
|
||||
{
|
||||
wxCHECK_MSG((pos>=0) && (pos<=m_clientList.GetCount()), -1, wxT("invalid index"));
|
||||
wxCHECK_MSG(pos<=m_clientList.GetCount(), -1, wxT("invalid index"));
|
||||
|
||||
GtkWidget *menu_item = gtk_menu_item_new_with_label( wxGTK_CONV( item ) );
|
||||
|
||||
size_t index;
|
||||
unsigned int index;
|
||||
if ( m_strings )
|
||||
{
|
||||
// sorted control, need to insert at the correct index
|
||||
@ -569,8 +569,8 @@ wxSize wxChoice::DoGetBestSize() const
|
||||
if ( m_widget )
|
||||
{
|
||||
int width;
|
||||
size_t count = GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
GetTextExtent( GetString(n), &width, NULL, NULL, NULL );
|
||||
if ( width > ret.x )
|
||||
|
@ -447,7 +447,7 @@ int wxComboBox::DoAppend( const wxString &item )
|
||||
EnableEvents();
|
||||
}
|
||||
|
||||
const size_t count = GetCount();
|
||||
const unsigned int count = GetCount();
|
||||
|
||||
if ( m_clientDataList.GetCount() < count )
|
||||
m_clientDataList.Append( (wxObject*) NULL );
|
||||
@ -459,7 +459,7 @@ int wxComboBox::DoAppend( const wxString &item )
|
||||
return count - 1;
|
||||
}
|
||||
|
||||
int wxComboBox::DoInsert( const wxString &item, int pos )
|
||||
int wxComboBox::DoInsert(const wxString &item, unsigned int pos)
|
||||
{
|
||||
wxCHECK_MSG( !(GetWindowStyle() & wxCB_SORT), -1,
|
||||
wxT("can't insert into sorted list"));
|
||||
@ -467,9 +467,9 @@ int wxComboBox::DoInsert( const wxString &item, int pos )
|
||||
wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid combobox") );
|
||||
wxCHECK_MSG( IsValidInsert(pos), -1, wxT("invalid index") );
|
||||
|
||||
size_t count = GetCount();
|
||||
unsigned int count = GetCount();
|
||||
|
||||
if ((size_t)pos == count)
|
||||
if (pos == count)
|
||||
return Append(item);
|
||||
|
||||
#ifdef __WXGTK24__
|
||||
@ -515,7 +515,7 @@ int wxComboBox::DoInsert( const wxString &item, int pos )
|
||||
return pos;
|
||||
}
|
||||
|
||||
void wxComboBox::DoSetItemClientData( int n, void* clientData )
|
||||
void wxComboBox::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
@ -525,7 +525,7 @@ void wxComboBox::DoSetItemClientData( int n, void* clientData )
|
||||
node->SetData( (wxObject*) clientData );
|
||||
}
|
||||
|
||||
void* wxComboBox::DoGetItemClientData( int n ) const
|
||||
void* wxComboBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid combobox") );
|
||||
|
||||
@ -534,7 +534,7 @@ void* wxComboBox::DoGetItemClientData( int n ) const
|
||||
return node ? node->GetData() : NULL;
|
||||
}
|
||||
|
||||
void wxComboBox::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
void wxComboBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
@ -546,7 +546,7 @@ void wxComboBox::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
node->SetData( (wxObject*) clientData );
|
||||
}
|
||||
|
||||
wxClientData* wxComboBox::DoGetItemClientObject( int n ) const
|
||||
wxClientData* wxComboBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, wxT("invalid combobox") );
|
||||
|
||||
@ -565,8 +565,8 @@ void wxComboBox::Clear()
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
GtkComboBox* combobox = GTK_COMBO_BOX( m_widget );
|
||||
const size_t count = GetCount();
|
||||
for (size_t i = 0; i < count; i++)
|
||||
const unsigned int count = GetCount();
|
||||
for (unsigned int i = 0; i < count; i++)
|
||||
gtk_combo_box_remove_text( combobox, 0 );
|
||||
}
|
||||
else // GTK+ < 2.4.0
|
||||
@ -592,7 +592,7 @@ void wxComboBox::Clear()
|
||||
InvalidateBestSize();
|
||||
}
|
||||
|
||||
void wxComboBox::Delete( int n )
|
||||
void wxComboBox::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
@ -641,7 +641,7 @@ void wxComboBox::Delete( int n )
|
||||
InvalidateBestSize();
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(int n, const wxString &text)
|
||||
void wxComboBox::SetString(unsigned int n, const wxString &text)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
@ -783,7 +783,7 @@ int wxComboBox::GetCurrentSelection() const
|
||||
return -1;
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetString( int n ) const
|
||||
wxString wxComboBox::GetString(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid combobox") );
|
||||
|
||||
@ -836,7 +836,7 @@ wxString wxComboBox::GetStringSelection() const
|
||||
int sel = gtk_combo_box_get_active( combobox );
|
||||
if (sel == -1)
|
||||
return wxEmptyString;
|
||||
return GetString( sel );
|
||||
return GetString(sel);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@ -858,7 +858,7 @@ wxString wxComboBox::GetStringSelection() const
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
size_t wxComboBox::GetCount() const
|
||||
unsigned int wxComboBox::GetCount() const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, 0, wxT("invalid combobox") );
|
||||
|
||||
@ -871,7 +871,7 @@ size_t wxComboBox::GetCount() const
|
||||
gtk_tree_model_get_iter_first( model, &iter );
|
||||
if (!gtk_list_store_iter_is_valid(GTK_LIST_STORE(model), &iter ))
|
||||
return 0;
|
||||
size_t ret = 1;
|
||||
unsigned int ret = 1;
|
||||
while (gtk_tree_model_iter_next( model, &iter ))
|
||||
ret++;
|
||||
return ret;
|
||||
@ -882,8 +882,12 @@ size_t wxComboBox::GetCount() const
|
||||
GtkWidget *list = GTK_COMBO(m_widget)->list;
|
||||
|
||||
GList *child = GTK_LIST(list)->children;
|
||||
size_t count = 0;
|
||||
while (child) { count++; child = child->next; }
|
||||
unsigned int count = 0;
|
||||
while (child)
|
||||
{
|
||||
count++;
|
||||
child = child->next;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@ -1347,10 +1351,10 @@ wxSize wxComboBox::DoGetBestSize() const
|
||||
if ( m_widget )
|
||||
{
|
||||
int width;
|
||||
size_t count = GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
GetTextExtent( GetString(n), &width, NULL, NULL, NULL );
|
||||
GetTextExtent(GetString(n), &width, NULL, NULL, NULL );
|
||||
if ( width > ret.x )
|
||||
ret.x = width;
|
||||
}
|
||||
|
@ -591,7 +591,7 @@ wxListBox::~wxListBox()
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxListBox::GtkInsertItems(const wxArrayString& items,
|
||||
void** clientData, size_t pos)
|
||||
void** clientData, unsigned int pos)
|
||||
{
|
||||
wxCHECK_RET( m_treeview != NULL, wxT("invalid listbox") );
|
||||
|
||||
@ -599,8 +599,8 @@ void wxListBox::GtkInsertItems(const wxArrayString& items,
|
||||
|
||||
// Create and set column ids and GValues
|
||||
|
||||
size_t nNum = items.GetCount();
|
||||
size_t nCurCount = wxListBox::GetCount();
|
||||
unsigned int nNum = items.GetCount();
|
||||
unsigned int nCurCount = wxListBox::GetCount();
|
||||
wxASSERT_MSG(pos <= nCurCount, wxT("Invalid index passed to wxListBox"));
|
||||
|
||||
GtkTreeIter* pIter = NULL; // append by default
|
||||
@ -620,7 +620,7 @@ void wxListBox::GtkInsertItems(const wxArrayString& items,
|
||||
pIter = &iter;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < nNum; ++i)
|
||||
for (unsigned int i = 0; i < nNum; ++i)
|
||||
{
|
||||
wxString label = items[i];
|
||||
|
||||
@ -660,17 +660,17 @@ void wxListBox::GtkInsertItems(const wxArrayString& items,
|
||||
}
|
||||
}
|
||||
|
||||
void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
void wxListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
|
||||
{
|
||||
wxCHECK_RET( IsValidInsert(pos), wxT("invalid index in wxListBox::InsertItems") );
|
||||
|
||||
GtkInsertItems(items, NULL, (size_t)pos);
|
||||
GtkInsertItems(items, NULL, pos);
|
||||
}
|
||||
|
||||
int wxListBox::DoAppend( const wxString& item )
|
||||
{
|
||||
// Call DoInsertItems
|
||||
int nWhere = (int)wxListBox::GetCount();
|
||||
unsigned int nWhere = wxListBox::GetCount();
|
||||
wxArrayString aItems;
|
||||
aItems.Add(item);
|
||||
wxListBox::DoInsertItems(aItems, nWhere);
|
||||
@ -697,7 +697,7 @@ void wxListBox::Clear()
|
||||
gtk_list_store_clear( m_liststore ); /* well, THAT was easy :) */
|
||||
}
|
||||
|
||||
void wxListBox::Delete( int n )
|
||||
void wxListBox::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( m_treeview != NULL, wxT("invalid listbox") );
|
||||
|
||||
@ -708,7 +708,7 @@ void wxListBox::Delete( int n )
|
||||
GTK_TREE_MODEL(m_liststore),
|
||||
&iter, NULL, //NULL = parent = get first
|
||||
n
|
||||
);
|
||||
);
|
||||
|
||||
wxCHECK_RET( res, wxT("wrong listbox index") );
|
||||
|
||||
@ -749,9 +749,9 @@ struct _GtkTreeEntry* wxListBox::GtkGetEntry(int n) const
|
||||
// client data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void* wxListBox::DoGetItemClientData( int n ) const
|
||||
void* wxListBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( n >= 0 && (size_t)n < wxListBox::GetCount(), NULL,
|
||||
wxCHECK_MSG( IsValid(n), NULL,
|
||||
wxT("Invalid index passed to GetItemClientData") );
|
||||
|
||||
GtkTreeEntry* entry = GtkGetEntry(n);
|
||||
@ -762,14 +762,14 @@ void* wxListBox::DoGetItemClientData( int n ) const
|
||||
return userdata;
|
||||
}
|
||||
|
||||
wxClientData* wxListBox::DoGetItemClientObject( int n ) const
|
||||
wxClientData* wxListBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return (wxClientData*) wxListBox::DoGetItemClientData(n);
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientData( int n, void* clientData )
|
||||
void wxListBox::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
wxCHECK_RET( n >= 0 && (size_t)n < wxListBox::GetCount(),
|
||||
wxCHECK_RET( IsValid(n),
|
||||
wxT("Invalid index passed to SetItemClientData") );
|
||||
|
||||
GtkTreeEntry* entry = GtkGetEntry(n);
|
||||
@ -779,7 +779,7 @@ void wxListBox::DoSetItemClientData( int n, void* clientData )
|
||||
g_object_unref(G_OBJECT(entry));
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
void wxListBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
// wxItemContainer already deletes data for us
|
||||
wxListBox::DoSetItemClientData(n, (void*) clientData);
|
||||
@ -789,7 +789,7 @@ void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
// string list access
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxListBox::SetString( int n, const wxString &string )
|
||||
void wxListBox::SetString(unsigned int n, const wxString &string)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n), wxT("invalid index in wxListBox::SetString") );
|
||||
wxCHECK_RET( m_treeview != NULL, wxT("invalid listbox") );
|
||||
@ -816,12 +816,12 @@ void wxListBox::SetString( int n, const wxString &string )
|
||||
|
||||
wxArrayString aItems;
|
||||
aItems.Add(label);
|
||||
GtkInsertItems(aItems, &userdata, (size_t)n);
|
||||
GtkInsertItems(aItems, &userdata, n);
|
||||
if (bWasSelected)
|
||||
wxListBox::GtkSetSelection(n, true, true);
|
||||
}
|
||||
|
||||
wxString wxListBox::GetString( int n ) const
|
||||
wxString wxListBox::GetString(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_treeview != NULL, wxEmptyString, wxT("invalid listbox") );
|
||||
|
||||
@ -842,11 +842,11 @@ wxString wxListBox::GetString( int n ) const
|
||||
return label;
|
||||
}
|
||||
|
||||
size_t wxListBox::GetCount() const
|
||||
unsigned int wxListBox::GetCount() const
|
||||
{
|
||||
wxCHECK_MSG( m_treeview != NULL, 0, wxT("invalid listbox") );
|
||||
|
||||
return (size_t)gtk_tree_model_iter_n_children(GTK_TREE_MODEL(m_liststore), NULL);
|
||||
return (unsigned int)gtk_tree_model_iter_n_children(GTK_TREE_MODEL(m_liststore), NULL);
|
||||
}
|
||||
|
||||
int wxListBox::FindString( const wxString &item, bool bCase ) const
|
||||
@ -854,9 +854,9 @@ int wxListBox::FindString( const wxString &item, bool bCase ) const
|
||||
wxCHECK_MSG( m_treeview != NULL, wxNOT_FOUND, wxT("invalid listbox") );
|
||||
|
||||
//Sort of hackish - maybe there is a faster way
|
||||
size_t nCount = wxListBox::GetCount();
|
||||
unsigned int nCount = wxListBox::GetCount();
|
||||
|
||||
for(size_t i = 0; i < nCount; ++i)
|
||||
for(unsigned int i = 0; i < nCount; ++i)
|
||||
{
|
||||
if( item.IsSameAs( wxListBox::GetString(i), bCase ) )
|
||||
return (int)i;
|
||||
@ -1095,13 +1095,13 @@ wxSize wxListBox::DoGetBestSize() const
|
||||
|
||||
// Get the visible area of the tree view (limit to the 10th item
|
||||
// so that it isn't too big)
|
||||
size_t count = GetCount();
|
||||
unsigned int count = GetCount();
|
||||
if (count)
|
||||
{
|
||||
int wLine;
|
||||
|
||||
// Find the widest line
|
||||
for(size_t i = 0; i < count; i++) {
|
||||
for(unsigned int i = 0; i < count; i++) {
|
||||
wxString str(GetString(i));
|
||||
GetTextExtent(str, &wLine, NULL);
|
||||
lbWidth = wxMax(lbWidth, wLine);
|
||||
@ -1119,8 +1119,8 @@ wxSize wxListBox::DoGetBestSize() const
|
||||
}
|
||||
#endif
|
||||
|
||||
// don't make the listbox too tall (limit height to around 10 items) but don't
|
||||
// make it too small neither
|
||||
// don't make the listbox too tall (limit height to around 10 items) but don't
|
||||
// make it too small neither
|
||||
lbHeight = (cy+4) * wxMin(wxMax(count, 3), 10);
|
||||
}
|
||||
|
||||
|
@ -213,8 +213,8 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
SetMajorDim(majorDim == 0 ? n : majorDim, style);
|
||||
|
||||
|
||||
int num_of_cols = GetColumnCount();
|
||||
int num_of_rows = GetRowCount();
|
||||
unsigned int num_of_cols = GetColumnCount();
|
||||
unsigned int num_of_rows = GetRowCount();
|
||||
|
||||
GtkRadioButton *m_radio = (GtkRadioButton*) NULL;
|
||||
|
||||
@ -226,7 +226,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
|
||||
wxString label;
|
||||
GSList *radio_button_group = (GSList *) NULL;
|
||||
for (int i = 0; i < n; i++)
|
||||
for (unsigned int i = 0; i < n; i++)
|
||||
{
|
||||
if ( i != 0 )
|
||||
radio_button_group = gtk_radio_button_get_group( GTK_RADIO_BUTTON(m_radio) );
|
||||
@ -381,7 +381,7 @@ int wxRadioBox::GetSelection(void) const
|
||||
return wxNOT_FOUND;
|
||||
}
|
||||
|
||||
wxString wxRadioBox::GetString( int n ) const
|
||||
wxString wxRadioBox::GetString(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid radiobox") );
|
||||
|
||||
@ -403,7 +403,7 @@ void wxRadioBox::SetLabel( const wxString& label )
|
||||
GTKSetLabelForFrame(GTK_FRAME(m_widget), label);
|
||||
}
|
||||
|
||||
void wxRadioBox::SetString( int item, const wxString& label )
|
||||
void wxRadioBox::SetString(unsigned int item, const wxString& label)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
|
||||
|
||||
@ -435,7 +435,7 @@ bool wxRadioBox::Enable( bool enable )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxRadioBox::Enable( int item, bool enable )
|
||||
bool wxRadioBox::Enable(unsigned int item, bool enable)
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
|
||||
|
||||
@ -452,7 +452,7 @@ bool wxRadioBox::Enable( int item, bool enable )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxRadioBox::IsItemEnabled(int item) const
|
||||
bool wxRadioBox::IsItemEnabled(unsigned int item) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
|
||||
|
||||
@ -467,7 +467,7 @@ bool wxRadioBox::IsItemEnabled(int item) const
|
||||
return GTK_WIDGET_SENSITIVE(GTK_WIDGET(button));
|
||||
}
|
||||
|
||||
bool wxRadioBox::Show( int item, bool show )
|
||||
bool wxRadioBox::Show(unsigned int item, bool show)
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
|
||||
|
||||
@ -485,7 +485,7 @@ bool wxRadioBox::Show( int item, bool show )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxRadioBox::IsItemShown(int item) const
|
||||
bool wxRadioBox::IsItemShown(unsigned int item) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
|
||||
|
||||
@ -498,7 +498,7 @@ bool wxRadioBox::IsItemShown(int item) const
|
||||
return GTK_WIDGET_VISIBLE(GTK_WIDGET(button));
|
||||
}
|
||||
|
||||
size_t wxRadioBox::GetCount() const
|
||||
unsigned int wxRadioBox::GetCount() const
|
||||
{
|
||||
return m_boxes.GetCount();
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
style, validator, name );
|
||||
}
|
||||
|
||||
bool wxCheckListBox::IsChecked( int index ) const
|
||||
bool wxCheckListBox::IsChecked(unsigned int index) const
|
||||
{
|
||||
wxCHECK_MSG( m_list != NULL, false, wxT("invalid checklistbox") );
|
||||
|
||||
@ -74,7 +74,7 @@ bool wxCheckListBox::IsChecked( int index ) const
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxCheckListBox::Check( int index, bool check )
|
||||
void wxCheckListBox::Check(unsigned int index, bool check )
|
||||
{
|
||||
wxCHECK_RET( m_list != NULL, wxT("invalid checklistbox") );
|
||||
|
||||
|
@ -133,7 +133,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
|
||||
|
||||
GtkWidget *menu = gtk_menu_new();
|
||||
|
||||
for (size_t i = 0; i < (size_t)n; i++)
|
||||
for (unsigned int i = 0; i < n; i++)
|
||||
{
|
||||
GtkAddHelper(menu, i, choices[i]);
|
||||
}
|
||||
@ -164,27 +164,27 @@ int wxChoice::DoAppend( const wxString &item )
|
||||
return GtkAddHelper(menu, GetCount(), item);
|
||||
}
|
||||
|
||||
int wxChoice::DoInsert( const wxString &item, int pos )
|
||||
int wxChoice::DoInsert( const wxString &item, unsigned int pos )
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid choice control") );
|
||||
wxCHECK_MSG( IsValidInsert(pos), -1, wxT("invalid index"));
|
||||
|
||||
if ((size_t)pos == GetCount())
|
||||
if (pos == GetCount())
|
||||
return DoAppend(item);
|
||||
|
||||
GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) );
|
||||
|
||||
// if the item to insert is at or before the selection, and the selection is valid
|
||||
if ((pos <= m_selection_hack) && (m_selection_hack != wxNOT_FOUND))
|
||||
if (((int)pos <= m_selection_hack) && (m_selection_hack != wxNOT_FOUND))
|
||||
{
|
||||
// move the selection forward one
|
||||
m_selection_hack++;
|
||||
}
|
||||
|
||||
return GtkAddHelper(menu, (size_t)pos, item);
|
||||
return GtkAddHelper(menu, pos, item);
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
void wxChoice::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") );
|
||||
|
||||
@ -194,7 +194,7 @@ void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
node->SetData( (wxObject*) clientData );
|
||||
}
|
||||
|
||||
void* wxChoice::DoGetItemClientData( int n ) const
|
||||
void* wxChoice::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid choice control") );
|
||||
|
||||
@ -204,7 +204,7 @@ void* wxChoice::DoGetItemClientData( int n ) const
|
||||
return node->GetData();
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
void wxChoice::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid choice control") );
|
||||
|
||||
@ -216,7 +216,7 @@ void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
node->SetData( (wxObject*) clientData );
|
||||
}
|
||||
|
||||
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
wxClientData* wxChoice::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid choice control") );
|
||||
|
||||
@ -256,24 +256,24 @@ void wxChoice::Clear()
|
||||
m_selection_hack = wxNOT_FOUND;
|
||||
}
|
||||
|
||||
void wxChoice::Delete( int n )
|
||||
void wxChoice::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid choice") );
|
||||
|
||||
// VZ: apparently GTK+ doesn't have a built-in function to do it (not even
|
||||
// in 2.0), hence this dumb implementation -- still better than nothing
|
||||
int i;
|
||||
size_t count = GetCount();
|
||||
unsigned int i;
|
||||
unsigned int count = GetCount();
|
||||
|
||||
wxCHECK_RET( IsValid(n), _T("invalid index in wxChoice::Delete") );
|
||||
|
||||
// if the item to delete is before the selection, and the selection is valid
|
||||
if ((n < m_selection_hack) && (m_selection_hack != wxNOT_FOUND))
|
||||
if (((int)n < m_selection_hack) && (m_selection_hack != wxNOT_FOUND))
|
||||
{
|
||||
// move the selection back one
|
||||
m_selection_hack--;
|
||||
}
|
||||
else if (n == m_selection_hack)
|
||||
else if ((int)n == m_selection_hack)
|
||||
{
|
||||
// invalidate the selection
|
||||
m_selection_hack = wxNOT_FOUND;
|
||||
@ -287,7 +287,7 @@ void wxChoice::Delete( int n )
|
||||
wxArrayString items;
|
||||
wxArrayPtrVoid itemsData;
|
||||
items.Alloc(count);
|
||||
for ( i = 0; (size_t)i < count; i++ )
|
||||
for ( i = 0; i < count; i++ )
|
||||
{
|
||||
if ( i != n )
|
||||
{
|
||||
@ -320,7 +320,7 @@ void wxChoice::Delete( int n )
|
||||
|
||||
Clear();
|
||||
|
||||
for ( i = 0; (size_t)i < count - 1; i++ )
|
||||
for ( i = 0; i < count - 1; i++ )
|
||||
{
|
||||
Append(items[i]);
|
||||
|
||||
@ -372,12 +372,12 @@ int wxChoice::GetSelection() const
|
||||
|
||||
}
|
||||
|
||||
void wxChoice::SetString( int n, const wxString& str )
|
||||
void wxChoice::SetString(unsigned int n, const wxString& str )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid choice") );
|
||||
|
||||
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
|
||||
int count = 0;
|
||||
unsigned int count = 0;
|
||||
GList *child = menu_shell->children;
|
||||
while (child)
|
||||
{
|
||||
@ -401,12 +401,12 @@ void wxChoice::SetString( int n, const wxString& str )
|
||||
}
|
||||
}
|
||||
|
||||
wxString wxChoice::GetString( int n ) const
|
||||
wxString wxChoice::GetString(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid choice") );
|
||||
|
||||
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
|
||||
int count = 0;
|
||||
unsigned int count = 0;
|
||||
GList *child = menu_shell->children;
|
||||
while (child)
|
||||
{
|
||||
@ -432,12 +432,12 @@ wxString wxChoice::GetString( int n ) const
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
size_t wxChoice::GetCount() const
|
||||
unsigned int wxChoice::GetCount() const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, 0, wxT("invalid choice") );
|
||||
|
||||
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
|
||||
size_t count = 0;
|
||||
unsigned int count = 0;
|
||||
GList *child = menu_shell->children;
|
||||
while (child)
|
||||
{
|
||||
@ -455,7 +455,7 @@ void wxChoice::SetSelection( int n )
|
||||
gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp );
|
||||
|
||||
// set the local selection variable manually
|
||||
if ((n >= 0) && ((size_t)n < GetCount()))
|
||||
if (IsValid((unsigned int)n))
|
||||
{
|
||||
// a valid selection has been made
|
||||
m_selection_hack = n;
|
||||
@ -498,7 +498,7 @@ void wxChoice::DoApplyWidgetStyle(GtkRcStyle *style)
|
||||
}
|
||||
}
|
||||
|
||||
int wxChoice::GtkAddHelper(GtkWidget *menu, size_t pos, const wxString& item)
|
||||
int wxChoice::GtkAddHelper(GtkWidget *menu, unsigned int pos, const wxString& item)
|
||||
{
|
||||
wxCHECK_MSG(pos<=m_clientList.GetCount(), -1, wxT("invalid index"));
|
||||
|
||||
@ -575,10 +575,10 @@ wxSize wxChoice::DoGetBestSize() const
|
||||
if ( m_widget )
|
||||
{
|
||||
int width;
|
||||
size_t count = GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
GetTextExtent( GetString(n), &width, NULL, NULL, NULL );
|
||||
GetTextExtent(GetString(n), &width, NULL, NULL, NULL );
|
||||
if ( width > ret.x )
|
||||
ret.x = width;
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ int wxComboBox::DoAppend( const wxString &item )
|
||||
|
||||
gtk_widget_show( list_item );
|
||||
|
||||
const size_t count = GetCount();
|
||||
const unsigned int count = GetCount();
|
||||
|
||||
if ( m_clientDataList.GetCount() < count )
|
||||
m_clientDataList.Append( (wxObject*) NULL );
|
||||
@ -361,7 +361,7 @@ int wxComboBox::DoAppend( const wxString &item )
|
||||
return count - 1;
|
||||
}
|
||||
|
||||
int wxComboBox::DoInsert( const wxString &item, int pos )
|
||||
int wxComboBox::DoInsert( const wxString &item, unsigned int pos )
|
||||
{
|
||||
wxCHECK_MSG( !(GetWindowStyle() & wxCB_SORT), -1,
|
||||
wxT("can't insert into sorted list"));
|
||||
@ -370,7 +370,7 @@ int wxComboBox::DoInsert( const wxString &item, int pos )
|
||||
|
||||
wxCHECK_MSG( IsValidInsert(pos), -1, wxT("invalid index") );
|
||||
|
||||
if ((size_t)pos == GetCount())
|
||||
if (pos == GetCount())
|
||||
return Append(item);
|
||||
|
||||
DisableEvents();
|
||||
@ -393,7 +393,7 @@ int wxComboBox::DoInsert( const wxString &item, int pos )
|
||||
|
||||
gtk_widget_show( list_item );
|
||||
|
||||
const size_t count = GetCount();
|
||||
const unsigned int count = GetCount();
|
||||
|
||||
if ( m_clientDataList.GetCount() < count )
|
||||
m_clientDataList.Insert( pos, (wxObject*) NULL );
|
||||
@ -407,7 +407,7 @@ int wxComboBox::DoInsert( const wxString &item, int pos )
|
||||
return pos;
|
||||
}
|
||||
|
||||
void wxComboBox::DoSetItemClientData( int n, void* clientData )
|
||||
void wxComboBox::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
@ -417,7 +417,7 @@ void wxComboBox::DoSetItemClientData( int n, void* clientData )
|
||||
node->SetData( (wxObject*) clientData );
|
||||
}
|
||||
|
||||
void* wxComboBox::DoGetItemClientData( int n ) const
|
||||
void* wxComboBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid combobox") );
|
||||
|
||||
@ -426,7 +426,7 @@ void* wxComboBox::DoGetItemClientData( int n ) const
|
||||
return node ? node->GetData() : NULL;
|
||||
}
|
||||
|
||||
void wxComboBox::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
void wxComboBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
@ -438,7 +438,7 @@ void wxComboBox::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
node->SetData( (wxObject*) clientData );
|
||||
}
|
||||
|
||||
wxClientData* wxComboBox::DoGetItemClientObject( int n ) const
|
||||
wxClientData* wxComboBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, wxT("invalid combobox") );
|
||||
|
||||
@ -472,7 +472,7 @@ void wxComboBox::Clear()
|
||||
InvalidateBestSize();
|
||||
}
|
||||
|
||||
void wxComboBox::Delete( int n )
|
||||
void wxComboBox::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
@ -509,7 +509,7 @@ void wxComboBox::Delete( int n )
|
||||
InvalidateBestSize();
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(int n, const wxString &text)
|
||||
void wxComboBox::SetString(unsigned int n, const wxString &text)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
@ -583,7 +583,7 @@ int wxComboBox::GetCurrentSelection() const
|
||||
return wxNOT_FOUND;
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetString( int n ) const
|
||||
wxString wxComboBox::GetString(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid combobox") );
|
||||
|
||||
@ -625,14 +625,14 @@ wxString wxComboBox::GetStringSelection() const
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
size_t wxComboBox::GetCount() const
|
||||
unsigned int wxComboBox::GetCount() const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, 0, wxT("invalid combobox") );
|
||||
|
||||
GtkWidget *list = GTK_COMBO(m_widget)->list;
|
||||
|
||||
GList *child = GTK_LIST(list)->children;
|
||||
size_t count = 0;
|
||||
unsigned int count = 0;
|
||||
while (child) { count++; child = child->next; }
|
||||
return count;
|
||||
}
|
||||
@ -929,10 +929,10 @@ wxSize wxComboBox::DoGetBestSize() const
|
||||
if ( m_widget )
|
||||
{
|
||||
int width;
|
||||
size_t count = GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
GetTextExtent( GetString(n), &width, NULL, NULL, NULL );
|
||||
GetTextExtent(GetString(n), &width, NULL, NULL, NULL );
|
||||
if ( width > ret.x )
|
||||
ret.x = width;
|
||||
}
|
||||
|
@ -573,7 +573,7 @@ wxListBox::~wxListBox()
|
||||
// adding items
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
void wxListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
|
||||
{
|
||||
wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
|
||||
|
||||
@ -593,12 +593,12 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
|
||||
wxCHECK_RET( pos <= length, wxT("invalid index in wxListBox::InsertItems") );
|
||||
|
||||
size_t nItems = items.GetCount();
|
||||
unsigned int nItems = items.GetCount();
|
||||
int index;
|
||||
|
||||
if (m_strings)
|
||||
{
|
||||
for (size_t n = 0; n < nItems; n++)
|
||||
for (unsigned int n = 0; n < nItems; n++)
|
||||
{
|
||||
index = m_strings->Add( items[n] );
|
||||
|
||||
@ -619,7 +619,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
{
|
||||
if (pos == length)
|
||||
{
|
||||
for ( size_t n = 0; n < nItems; n++ )
|
||||
for ( unsigned int n = 0; n < nItems; n++ )
|
||||
{
|
||||
GtkAddItem( items[n] );
|
||||
|
||||
@ -629,7 +629,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
else
|
||||
{
|
||||
wxList::compatibility_iterator node = m_clientList.Item( pos );
|
||||
for ( size_t n = 0; n < nItems; n++ )
|
||||
for ( unsigned int n = 0; n < nItems; n++ )
|
||||
{
|
||||
GtkAddItem( items[n], pos+n );
|
||||
|
||||
@ -757,8 +757,8 @@ void wxListBox::DoSetItems( const wxArrayString& items,
|
||||
|
||||
if ( clientData )
|
||||
{
|
||||
size_t count = items.GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = items.GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
SetClientData(n, clientData[n]);
|
||||
}
|
||||
@ -799,7 +799,7 @@ void wxListBox::Clear()
|
||||
m_strings->Clear();
|
||||
}
|
||||
|
||||
void wxListBox::Delete( int n )
|
||||
void wxListBox::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
|
||||
|
||||
@ -831,7 +831,7 @@ void wxListBox::Delete( int n )
|
||||
// client data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxListBox::DoSetItemClientData( int n, void* clientData )
|
||||
void wxListBox::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid listbox control") );
|
||||
|
||||
@ -841,7 +841,7 @@ void wxListBox::DoSetItemClientData( int n, void* clientData )
|
||||
node->SetData( (wxObject*) clientData );
|
||||
}
|
||||
|
||||
void* wxListBox::DoGetItemClientData( int n ) const
|
||||
void* wxListBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid listbox control") );
|
||||
|
||||
@ -851,7 +851,7 @@ void* wxListBox::DoGetItemClientData( int n ) const
|
||||
return node->GetData();
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
void wxListBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid listbox control") );
|
||||
|
||||
@ -863,7 +863,7 @@ void wxListBox::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
node->SetData( (wxObject*) clientData );
|
||||
}
|
||||
|
||||
wxClientData* wxListBox::DoGetItemClientObject( int n ) const
|
||||
wxClientData* wxListBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid listbox control") );
|
||||
|
||||
@ -898,7 +898,7 @@ wxString wxListBox::GetRealLabel(GList *item) const
|
||||
return str;
|
||||
}
|
||||
|
||||
void wxListBox::SetString( int n, const wxString &string )
|
||||
void wxListBox::SetString(unsigned int n, const wxString &string)
|
||||
{
|
||||
wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
|
||||
|
||||
@ -923,7 +923,7 @@ void wxListBox::SetString( int n, const wxString &string )
|
||||
}
|
||||
}
|
||||
|
||||
wxString wxListBox::GetString( int n ) const
|
||||
wxString wxListBox::GetString(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_list != NULL, wxEmptyString, wxT("invalid listbox") );
|
||||
|
||||
@ -938,7 +938,7 @@ wxString wxListBox::GetString( int n ) const
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
size_t wxListBox::GetCount() const
|
||||
unsigned int wxListBox::GetCount() const
|
||||
{
|
||||
wxCHECK_MSG( m_list != NULL, 0, wxT("invalid listbox") );
|
||||
|
||||
@ -1216,7 +1216,7 @@ wxSize wxListBox::DoGetBestSize() const
|
||||
int wLine;
|
||||
|
||||
// Find the widest line
|
||||
for(size_t i = 0; i < GetCount(); i++) {
|
||||
for(unsigned int i = 0; i < GetCount(); i++) {
|
||||
wxString str(GetString(i));
|
||||
GetTextExtent(str, &wLine, NULL);
|
||||
lbWidth = wxMax(lbWidth, wLine);
|
||||
|
@ -206,8 +206,8 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
SetMajorDim(majorDim == 0 ? n : majorDim, style);
|
||||
|
||||
|
||||
int num_of_cols = GetColumnCount();
|
||||
int num_of_rows = GetRowCount();
|
||||
unsigned int num_of_cols = GetColumnCount();
|
||||
unsigned int num_of_rows = GetRowCount();
|
||||
|
||||
GtkRadioButton *m_radio = (GtkRadioButton*) NULL;
|
||||
|
||||
@ -290,7 +290,7 @@ wxRadioBox::~wxRadioBox()
|
||||
}
|
||||
}
|
||||
|
||||
bool wxRadioBox::Show( bool show )
|
||||
bool wxRadioBox::Show(bool show)
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
|
||||
|
||||
@ -375,7 +375,7 @@ int wxRadioBox::GetSelection(void) const
|
||||
return wxNOT_FOUND;
|
||||
}
|
||||
|
||||
wxString wxRadioBox::GetString( int n ) const
|
||||
wxString wxRadioBox::GetString(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid radiobox") );
|
||||
|
||||
@ -397,7 +397,7 @@ void wxRadioBox::SetLabel( const wxString& label )
|
||||
GTKSetLabelForFrame(GTK_FRAME(m_widget), label);
|
||||
}
|
||||
|
||||
void wxRadioBox::SetString( int item, const wxString& label )
|
||||
void wxRadioBox::SetString(unsigned int item, const wxString& label)
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
|
||||
|
||||
@ -429,7 +429,7 @@ bool wxRadioBox::Enable( bool enable )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxRadioBox::Enable( int item, bool enable )
|
||||
bool wxRadioBox::Enable(unsigned int item, bool enable)
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
|
||||
|
||||
@ -446,7 +446,7 @@ bool wxRadioBox::Enable( int item, bool enable )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxRadioBox::IsItemEnabled(int item) const
|
||||
bool wxRadioBox::IsItemEnabled(unsigned int item) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
|
||||
|
||||
@ -461,7 +461,7 @@ bool wxRadioBox::IsItemEnabled(int item) const
|
||||
return GTK_WIDGET_SENSITIVE(GTK_WIDGET(button));
|
||||
}
|
||||
|
||||
bool wxRadioBox::Show( int item, bool show )
|
||||
bool wxRadioBox::Show(unsigned int item, bool show)
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
|
||||
|
||||
@ -479,7 +479,7 @@ bool wxRadioBox::Show( int item, bool show )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxRadioBox::IsItemShown(int item) const
|
||||
bool wxRadioBox::IsItemShown(unsigned int item) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
|
||||
|
||||
@ -492,7 +492,7 @@ bool wxRadioBox::IsItemShown(int item) const
|
||||
return GTK_WIDGET_VISIBLE(GTK_WIDGET(button));
|
||||
}
|
||||
|
||||
size_t wxRadioBox::GetCount() const
|
||||
unsigned int wxRadioBox::GetCount() const
|
||||
{
|
||||
return m_boxes.GetCount();
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ static pascal OSStatus ListBoxGetSetItemData(
|
||||
int i = itemID - 1;
|
||||
if ((i >= 0) && (i < (int)list->GetCount()))
|
||||
{
|
||||
verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData, list->IsChecked( i ) ? kThemeButtonOn : kThemeButtonOff ) );
|
||||
verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData, list->IsChecked(i) ? kThemeButtonOn : kThemeButtonOff ) );
|
||||
err = noErr;
|
||||
}
|
||||
}
|
||||
@ -184,7 +184,7 @@ static pascal OSStatus ListBoxGetSetItemData(
|
||||
if ((i >= 0) && (i < (int)list->GetCount()))
|
||||
{
|
||||
// we have to change this behind the back, since Check() would be triggering another update round
|
||||
bool newVal = !list->IsChecked( i );
|
||||
bool newVal = !list->IsChecked(i);
|
||||
verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData, newVal ? kThemeButtonOn : kThemeButtonOff ) );
|
||||
err = noErr;
|
||||
list->m_checks[i] = newVal;
|
||||
@ -336,17 +336,17 @@ bool wxCheckListBox::Create(
|
||||
// wxCheckListBox functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxCheckListBox::IsChecked(size_t item) const
|
||||
bool wxCheckListBox::IsChecked(unsigned int item) const
|
||||
{
|
||||
wxCHECK_MSG( item < m_checks.GetCount(), false,
|
||||
wxCHECK_MSG( IsValid(item), false,
|
||||
wxT("invalid index in wxCheckListBox::IsChecked") );
|
||||
|
||||
return m_checks[item] != 0;
|
||||
}
|
||||
|
||||
void wxCheckListBox::Check(size_t item, bool check)
|
||||
void wxCheckListBox::Check(unsigned int item, bool check)
|
||||
{
|
||||
wxCHECK_RET( item < m_checks.GetCount(),
|
||||
wxCHECK_RET( IsValid(item),
|
||||
wxT("invalid index in wxCheckListBox::Check") );
|
||||
|
||||
bool isChecked = m_checks[item] != 0;
|
||||
@ -365,9 +365,9 @@ void wxCheckListBox::Check(size_t item, bool check)
|
||||
// methods forwarded to wxCheckListBox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxCheckListBox::Delete(int n)
|
||||
void wxCheckListBox::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( (size_t)n < GetCount(), wxT("invalid index in wxCheckListBox::Delete") );
|
||||
wxCHECK_RET( IsValid(n), wxT("invalid index in wxCheckListBox::Delete") );
|
||||
|
||||
wxListBox::Delete( n );
|
||||
m_checks.RemoveAt( n );
|
||||
@ -383,12 +383,12 @@ int wxCheckListBox::DoAppend(const wxString& item)
|
||||
return pos;
|
||||
}
|
||||
|
||||
void wxCheckListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
void wxCheckListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
|
||||
{
|
||||
wxListBox::DoInsertItems( items, pos );
|
||||
|
||||
size_t count = items.GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = items.GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
m_checks.Insert( false, pos + n );
|
||||
}
|
||||
@ -399,8 +399,8 @@ void wxCheckListBox::DoSetItems(const wxArrayString& items, void **clientData)
|
||||
// call it first as it does DoClear()
|
||||
wxListBox::DoSetItems( items, clientData );
|
||||
|
||||
size_t count = items.GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = items.GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
m_checks.Add( false );
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ wxChoice::~wxChoice()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
size_t i, max = GetCount();
|
||||
unsigned int i, max = GetCount();
|
||||
|
||||
for ( i = 0; i < max; ++i )
|
||||
delete GetClientObject( i );
|
||||
@ -108,7 +108,7 @@ int wxChoice::DoAppend( const wxString& item )
|
||||
{
|
||||
#if wxUSE_STL
|
||||
wxArrayString::iterator insertPoint;
|
||||
size_t index;
|
||||
unsigned int index;
|
||||
|
||||
if (GetWindowStyle() & wxCB_SORT)
|
||||
{
|
||||
@ -123,7 +123,7 @@ int wxChoice::DoAppend( const wxString& item )
|
||||
|
||||
m_strings.insert( insertPoint, item );
|
||||
#else
|
||||
size_t index = m_strings.Add( item );
|
||||
unsigned int index = m_strings.Add( item );
|
||||
#endif
|
||||
|
||||
m_datas.Insert( NULL , index );
|
||||
@ -134,12 +134,12 @@ int wxChoice::DoAppend( const wxString& item )
|
||||
return index;
|
||||
}
|
||||
|
||||
int wxChoice::DoInsert( const wxString& item, int pos )
|
||||
int wxChoice::DoInsert( const wxString& item, unsigned int pos )
|
||||
{
|
||||
wxCHECK_MSG( !(GetWindowStyle() & wxCB_SORT), -1, wxT("wxChoice::DoInsert: can't insert into sorted list") );
|
||||
wxCHECK_MSG( IsValidInsert(pos), -1, wxT("wxChoice::DoInsert: invalid index") );
|
||||
|
||||
if ((size_t)pos == GetCount())
|
||||
if (pos == GetCount())
|
||||
return DoAppend( item );
|
||||
|
||||
UMAInsertMenuItem( MAC_WXHMENU( m_macPopUpMenuHandle ), item, m_font.GetEncoding(), pos );
|
||||
@ -151,7 +151,7 @@ int wxChoice::DoInsert( const wxString& item, int pos )
|
||||
return pos;
|
||||
}
|
||||
|
||||
void wxChoice::Delete( int n )
|
||||
void wxChoice::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n) , wxT("wxChoice::Delete: invalid index") );
|
||||
|
||||
@ -167,7 +167,7 @@ void wxChoice::Delete( int n )
|
||||
void wxChoice::Clear()
|
||||
{
|
||||
FreeData();
|
||||
for ( size_t i = 0 ; i < GetCount() ; i++ )
|
||||
for ( unsigned int i = 0 ; i < GetCount() ; i++ )
|
||||
{
|
||||
::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , 1 ) ;
|
||||
}
|
||||
@ -181,8 +181,8 @@ void wxChoice::FreeData()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
size_t count = GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
delete GetClientObject( n );
|
||||
}
|
||||
@ -206,7 +206,7 @@ void wxChoice::SetSelection( int n )
|
||||
// string list functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
size_t wxChoice::GetCount() const
|
||||
unsigned int wxChoice::GetCount() const
|
||||
{
|
||||
return m_strings.GetCount() ;
|
||||
}
|
||||
@ -216,7 +216,7 @@ int wxChoice::FindString( const wxString& s, bool bCase ) const
|
||||
return m_strings.Index( s , bCase ) ;
|
||||
}
|
||||
|
||||
void wxChoice::SetString( int n, const wxString& s )
|
||||
void wxChoice::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n), wxT("wxChoice::SetString(): invalid index") );
|
||||
|
||||
@ -226,7 +226,7 @@ void wxChoice::SetString( int n, const wxString& s )
|
||||
UMASetMenuItemText( MAC_WXHMENU(m_macPopUpMenuHandle) , n + 1 , s , wxFont::GetDefaultEncoding() ) ;
|
||||
}
|
||||
|
||||
wxString wxChoice::GetString( int n ) const
|
||||
wxString wxChoice::GetString(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid(n), wxEmptyString, wxT("wxChoice::GetString(): invalid index") );
|
||||
|
||||
@ -236,26 +236,26 @@ wxString wxChoice::GetString( int n ) const
|
||||
// ----------------------------------------------------------------------------
|
||||
// client data
|
||||
// ----------------------------------------------------------------------------
|
||||
void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
void wxChoice::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n), wxT("wxChoice::DoSetItemClientData: invalid index") );
|
||||
|
||||
m_datas[n] = (char*)clientData ;
|
||||
}
|
||||
|
||||
void * wxChoice::DoGetItemClientData( int n ) const
|
||||
void * wxChoice::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid(n), NULL, wxT("wxChoice::DoGetClientData: invalid index") );
|
||||
|
||||
return (void *)m_datas[n];
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
void wxChoice::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
DoSetItemClientData( n, clientData ) ;
|
||||
DoSetItemClientData(n, clientData);
|
||||
}
|
||||
|
||||
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
wxClientData* wxChoice::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return (wxClientData*)DoGetItemClientData( n ) ;
|
||||
}
|
||||
@ -312,9 +312,9 @@ wxSize wxChoice::DoGetBestSize() const
|
||||
}
|
||||
|
||||
// Find the widest line
|
||||
for(size_t i = 0; i < GetCount(); i++)
|
||||
for(unsigned int i = 0; i < GetCount(); i++)
|
||||
{
|
||||
wxString str( GetString( i ) );
|
||||
wxString str(GetString(i));
|
||||
|
||||
#if wxUSE_UNICODE
|
||||
Point bounds = { 0, 0 } ;
|
||||
|
@ -410,7 +410,7 @@ wxString wxComboBox::GetValue() const
|
||||
return result;
|
||||
}
|
||||
|
||||
size_t wxComboBox::GetCount() const
|
||||
unsigned int wxComboBox::GetCount() const
|
||||
{
|
||||
return m_choice->GetCount() ;
|
||||
}
|
||||
@ -506,27 +506,27 @@ int wxComboBox::DoAppend(const wxString& item)
|
||||
return m_choice->DoAppend( item ) ;
|
||||
}
|
||||
|
||||
int wxComboBox::DoInsert(const wxString& item, int pos)
|
||||
int wxComboBox::DoInsert(const wxString& item, unsigned int pos)
|
||||
{
|
||||
return m_choice->DoInsert( item , pos ) ;
|
||||
}
|
||||
|
||||
void wxComboBox::DoSetItemClientData(int n, void* clientData)
|
||||
void wxComboBox::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
return m_choice->DoSetItemClientData( n , clientData ) ;
|
||||
}
|
||||
|
||||
void* wxComboBox::DoGetItemClientData(int n) const
|
||||
void* wxComboBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
return m_choice->DoGetItemClientData( n ) ;
|
||||
}
|
||||
|
||||
void wxComboBox::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||
void wxComboBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
return m_choice->DoSetItemClientObject( n , clientData ) ;
|
||||
return m_choice->DoSetItemClientObject(n, clientData);
|
||||
}
|
||||
|
||||
wxClientData* wxComboBox::DoGetItemClientObject(int n) const
|
||||
wxClientData* wxComboBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return m_choice->DoGetItemClientObject( n ) ;
|
||||
}
|
||||
@ -535,15 +535,15 @@ void wxComboBox::FreeData()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
size_t count = GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
SetClientObject( n, NULL );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxComboBox::Delete(int n)
|
||||
void wxComboBox::Delete(unsigned int n)
|
||||
{
|
||||
// force client object deletion
|
||||
if( HasClientObjectData() )
|
||||
@ -567,7 +567,7 @@ void wxComboBox::SetSelection(int n)
|
||||
m_choice->SetSelection( n );
|
||||
|
||||
if ( m_text != NULL )
|
||||
m_text->SetValue( GetString( n ) );
|
||||
m_text->SetValue(GetString(n));
|
||||
}
|
||||
|
||||
int wxComboBox::FindString(const wxString& s, bool bCase) const
|
||||
@ -575,7 +575,7 @@ int wxComboBox::FindString(const wxString& s, bool bCase) const
|
||||
return m_choice->FindString( s, bCase );
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetString(int n) const
|
||||
wxString wxComboBox::GetString(unsigned int n) const
|
||||
{
|
||||
return m_choice->GetString( n );
|
||||
}
|
||||
@ -583,15 +583,15 @@ wxString wxComboBox::GetString(int n) const
|
||||
wxString wxComboBox::GetStringSelection() const
|
||||
{
|
||||
int sel = GetSelection();
|
||||
if (sel > -1)
|
||||
return wxString(this->GetString (sel));
|
||||
if (sel != wxNOT_FOUND)
|
||||
return wxString(this->GetString((unsigned int)sel));
|
||||
else
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(int n, const wxString& s)
|
||||
void wxComboBox::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
m_choice->SetString( n , s ) ;
|
||||
m_choice->SetString( n , s );
|
||||
}
|
||||
|
||||
bool wxComboBox::IsEditable() const
|
||||
|
@ -561,7 +561,7 @@ int wxComboBox::DoAppend(const wxString& item)
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxComboBox::DoInsert(const wxString& item, int pos)
|
||||
int wxComboBox::DoInsert(const wxString& item, unsigned int pos)
|
||||
{
|
||||
#if USE_HICOMBOBOX
|
||||
HIComboBoxInsertTextItemAtIndex( *m_peer, (CFIndex)pos, wxMacCFStringHolder(item, m_font.GetEncoding()) );
|
||||
@ -574,7 +574,7 @@ int wxComboBox::DoInsert(const wxString& item, int pos)
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxComboBox::DoSetItemClientData(int n, void* clientData)
|
||||
void wxComboBox::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
#if USE_HICOMBOBOX
|
||||
return; //TODO
|
||||
@ -583,7 +583,7 @@ void wxComboBox::DoSetItemClientData(int n, void* clientData)
|
||||
#endif
|
||||
}
|
||||
|
||||
void* wxComboBox::DoGetItemClientData(int n) const
|
||||
void* wxComboBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
#if USE_HICOMBOBOX
|
||||
return NULL; //TODO
|
||||
@ -592,7 +592,7 @@ void* wxComboBox::DoGetItemClientData(int n) const
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxComboBox::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||
void wxComboBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
#if USE_HICOMBOBOX
|
||||
return; //TODO
|
||||
@ -601,7 +601,7 @@ void wxComboBox::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||
#endif
|
||||
}
|
||||
|
||||
wxClientData* wxComboBox::DoGetItemClientObject(int n) const
|
||||
wxClientData* wxComboBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
#if USE_HICOMBOBOX
|
||||
return NULL;
|
||||
@ -612,25 +612,25 @@ wxClientData* wxComboBox::DoGetItemClientObject(int n) const
|
||||
|
||||
void wxComboBox::FreeData()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
if (HasClientObjectData())
|
||||
{
|
||||
size_t count = GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
SetClientObject( n, NULL );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int wxComboBox::GetCount() const {
|
||||
unsigned int wxComboBox::GetCount() const {
|
||||
#if USE_HICOMBOBOX
|
||||
return (int) HIComboBoxGetItemCount( *m_peer );
|
||||
return (unsigned int) HIComboBoxGetItemCount( *m_peer );
|
||||
#else
|
||||
return m_choice->GetCount() ;
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxComboBox::Delete(int n)
|
||||
void wxComboBox::Delete(unsigned int n)
|
||||
{
|
||||
#if USE_HICOMBOBOX
|
||||
HIComboBoxRemoveItemAtIndex( *m_peer, (CFIndex)n );
|
||||
@ -672,7 +672,7 @@ void wxComboBox::SetSelection(int n)
|
||||
|
||||
if ( m_text != NULL )
|
||||
{
|
||||
m_text->SetValue( GetString( n ) );
|
||||
m_text->SetValue(GetString(n));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -680,9 +680,9 @@ void wxComboBox::SetSelection(int n)
|
||||
int wxComboBox::FindString(const wxString& s, bool bCase) const
|
||||
{
|
||||
#if USE_HICOMBOBOX
|
||||
for( int i = 0 ; i < GetCount() ; i++ )
|
||||
for( unsigned int i = 0 ; i < GetCount() ; i++ )
|
||||
{
|
||||
if ( GetString( i ).IsSameAs(s, bCase) )
|
||||
if (GetString(i).IsSameAs(s, bCase) )
|
||||
return i ;
|
||||
}
|
||||
return wxNOT_FOUND ;
|
||||
@ -691,7 +691,7 @@ int wxComboBox::FindString(const wxString& s, bool bCase) const
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetString(int n) const
|
||||
wxString wxComboBox::GetString(unsigned int n) const
|
||||
{
|
||||
#if USE_HICOMBOBOX
|
||||
CFStringRef itemText;
|
||||
@ -708,14 +708,14 @@ wxString wxComboBox::GetStringSelection() const
|
||||
return wxMacCFStringHolder(m_peer->GetData<CFStringRef>(kHIComboBoxEditTextPart,kControlEditTextCFStringTag)).AsString() ;
|
||||
#else
|
||||
int sel = GetSelection ();
|
||||
if (sel > -1)
|
||||
return wxString(this->GetString (sel));
|
||||
if (sel != wxNOT_FOUND)
|
||||
return wxString(this->GetString((unsigned int)sel));
|
||||
else
|
||||
return wxEmptyString;
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(int n, const wxString& s)
|
||||
void wxComboBox::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
#if USE_HICOMBOBOX
|
||||
verify_noerr ( HIComboBoxInsertTextItemAtIndex( *m_peer, (CFIndex) n,
|
||||
|
@ -326,7 +326,7 @@ void wxListBox::FreeData()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
for ( size_t n = 0; n < m_noItems; n++ )
|
||||
for ( unsigned int n = 0; n < m_noItems; n++ )
|
||||
{
|
||||
delete GetClientObject( n );
|
||||
}
|
||||
@ -345,7 +345,7 @@ void wxListBox::DoSetFirstItem(int n)
|
||||
MacScrollTo( n ) ;
|
||||
}
|
||||
|
||||
void wxListBox::Delete(int n)
|
||||
void wxListBox::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n),
|
||||
wxT("invalid index in wxListBox::Delete") );
|
||||
@ -364,7 +364,7 @@ int wxListBox::DoAppend(const wxString& item)
|
||||
{
|
||||
InvalidateBestSize();
|
||||
|
||||
size_t index = m_noItems ;
|
||||
unsigned int index = m_noItems ;
|
||||
m_stringArray.Add( item ) ;
|
||||
m_dataArray.Add( NULL );
|
||||
m_noItems++;
|
||||
@ -377,7 +377,7 @@ int wxListBox::DoAppend(const wxString& item)
|
||||
void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
|
||||
{
|
||||
Clear() ;
|
||||
size_t n = choices.GetCount();
|
||||
unsigned int n = choices.GetCount();
|
||||
|
||||
for ( size_t i = 0 ; i < n ; ++i )
|
||||
{
|
||||
@ -397,7 +397,7 @@ int wxListBox::FindString(const wxString& s, bool bCase) const
|
||||
Str255 s1 , s2 ;
|
||||
wxMacStringToPascal( search , s2 ) ;
|
||||
|
||||
for ( size_t i = 0 ; i < m_noItems ; ++ i )
|
||||
for ( unsigned int i = 0 ; i < m_noItems ; ++ i )
|
||||
{
|
||||
wxMacStringToPascal( m_stringArray[i].Left( len ) , s1 ) ;
|
||||
|
||||
@ -410,9 +410,9 @@ int wxListBox::FindString(const wxString& s, bool bCase) const
|
||||
wxString st = s ;
|
||||
st.MakeLower() ;
|
||||
|
||||
for ( size_t i = 0 ; i < m_noItems ; ++i )
|
||||
for ( unsigned int i = 0 ; i < m_noItems ; ++i )
|
||||
{
|
||||
if ( GetString( i ).Lower().Matches(st) )
|
||||
if (GetString(i).Lower().Matches(st) )
|
||||
return (int)i ;
|
||||
}
|
||||
}
|
||||
@ -423,7 +423,7 @@ int wxListBox::FindString(const wxString& s, bool bCase) const
|
||||
|
||||
wxMacStringToPascal( s , s2 ) ;
|
||||
|
||||
for ( size_t i = 0 ; i < m_noItems ; ++ i )
|
||||
for ( unsigned int i = 0 ; i < m_noItems ; ++ i )
|
||||
{
|
||||
wxMacStringToPascal( m_stringArray[i] , s1 ) ;
|
||||
|
||||
@ -463,33 +463,33 @@ bool wxListBox::IsSelected(int n) const
|
||||
return MacIsSelected( n ) ;
|
||||
}
|
||||
|
||||
void *wxListBox::DoGetItemClientData(int n) const
|
||||
void *wxListBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid(n), NULL, wxT("invalid index in wxListBox::GetClientData"));
|
||||
|
||||
wxASSERT_MSG( m_dataArray.GetCount() >= (size_t) n , wxT("invalid client_data array") ) ;
|
||||
wxASSERT_MSG( m_dataArray.GetCount() >= (unsigned int) n , wxT("invalid client_data array") ) ;
|
||||
|
||||
return (void *)m_dataArray[n];
|
||||
}
|
||||
|
||||
wxClientData *wxListBox::DoGetItemClientObject(int n) const
|
||||
wxClientData *wxListBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return (wxClientData *) DoGetItemClientData( n ) ;
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientData(int n, void *clientData)
|
||||
void wxListBox::DoSetItemClientData(unsigned int n, void *clientData)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n), wxT("invalid index in wxListBox::SetClientData") );
|
||||
|
||||
wxASSERT_MSG( m_dataArray.GetCount() >= (size_t) n , wxT("invalid client_data array") ) ;
|
||||
wxASSERT_MSG( m_dataArray.GetCount() >= (unsigned int) n , wxT("invalid client_data array") ) ;
|
||||
|
||||
if ( m_dataArray.GetCount() > (size_t) n )
|
||||
if ( m_dataArray.GetCount() > (unsigned int) n )
|
||||
m_dataArray[n] = (char*)clientData ;
|
||||
else
|
||||
m_dataArray.Add( (char*)clientData ) ;
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||
void wxListBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
DoSetItemClientData(n, clientData);
|
||||
}
|
||||
@ -507,7 +507,7 @@ int wxListBox::GetSelection() const
|
||||
}
|
||||
|
||||
// Find string for position
|
||||
wxString wxListBox::GetString(int n) const
|
||||
wxString wxListBox::GetString(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid(n), wxEmptyString,
|
||||
wxT("invalid index in wxListBox::GetString") );
|
||||
@ -515,16 +515,16 @@ wxString wxListBox::GetString(int n) const
|
||||
return m_stringArray[n] ;
|
||||
}
|
||||
|
||||
void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
void wxListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
|
||||
{
|
||||
wxCHECK_RET( IsValidInsert(pos),
|
||||
wxT("invalid index in wxListBox::InsertItems") );
|
||||
|
||||
InvalidateBestSize();
|
||||
|
||||
size_t nItems = items.GetCount();
|
||||
unsigned int nItems = items.GetCount();
|
||||
|
||||
for ( size_t i = 0 ; i < nItems ; i++ )
|
||||
for ( unsigned int i = 0 ; i < nItems ; i++ )
|
||||
{
|
||||
m_stringArray.Insert( items[i] , pos + i ) ;
|
||||
m_dataArray.Insert( NULL , pos + i ) ;
|
||||
@ -533,7 +533,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
}
|
||||
}
|
||||
|
||||
void wxListBox::SetString(int n, const wxString& s)
|
||||
void wxListBox::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
m_stringArray[n] = s ;
|
||||
MacSet( n , s ) ;
|
||||
@ -563,9 +563,9 @@ wxSize wxListBox::DoGetBestSize() const
|
||||
}
|
||||
|
||||
// Find the widest line
|
||||
for (size_t i = 0; i < GetCount(); i++)
|
||||
for (unsigned int i = 0; i < GetCount(); i++)
|
||||
{
|
||||
wxString str( GetString( i ) );
|
||||
wxString str(GetString(i));
|
||||
|
||||
#if wxUSE_UNICODE
|
||||
Point bounds = {0, 0} ;
|
||||
@ -603,7 +603,7 @@ wxSize wxListBox::DoGetBestSize() const
|
||||
return wxSize( lbWidth, lbHeight );
|
||||
}
|
||||
|
||||
size_t wxListBox::GetCount() const
|
||||
unsigned int wxListBox::GetCount() const
|
||||
{
|
||||
return m_noItems;
|
||||
}
|
||||
@ -638,7 +638,7 @@ void wxListBox::MacDelete( int n )
|
||||
UInt32 id = m_noItems + 1 ;
|
||||
|
||||
verify_noerr( m_peer->RemoveItems( kDataBrowserNoItem , 1 , (UInt32*) &id , kDataBrowserItemNoProperty ) ) ;
|
||||
for ( size_t i = 0 ; i < selectionBefore.GetCount() ; ++i )
|
||||
for ( unsigned int i = 0 ; i < selectionBefore.GetCount() ; ++i )
|
||||
{
|
||||
int current = selectionBefore[i] ;
|
||||
if ( current == n )
|
||||
@ -737,7 +737,7 @@ bool wxListBox::MacIsSelected( int n ) const
|
||||
|
||||
int wxListBox::MacGetSelection() const
|
||||
{
|
||||
for ( size_t i = 0 ; i < GetCount() ; ++i )
|
||||
for ( unsigned int i = 0 ; i < GetCount() ; ++i )
|
||||
{
|
||||
if ( m_peer->IsItemSelected( i + 1 ) )
|
||||
return i ;
|
||||
@ -956,7 +956,7 @@ void wxListBox::OnChar(wxKeyEvent& event)
|
||||
event.SetClientObject( GetClientObject( n ) );
|
||||
else if ( HasClientUntypedData() )
|
||||
event.SetClientData( GetClientData( n ) );
|
||||
event.SetString( GetString( n ) );
|
||||
event.SetString(GetString(n));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -988,8 +988,8 @@ void wxListBox::OnChar(wxKeyEvent& event)
|
||||
event.SetClientObject( GetClientObject( line ) );
|
||||
else if ( HasClientUntypedData() )
|
||||
event.SetClientData( GetClientData( line ) );
|
||||
event.SetString( GetString( line ) );
|
||||
event.SetInt( line );
|
||||
event.SetString(GetString(line));
|
||||
event.SetInt(line);
|
||||
|
||||
GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
@ -32,10 +32,10 @@ void wxRadioBox::OnRadioButton( wxCommandEvent &outer )
|
||||
{
|
||||
wxCommandEvent event( wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId );
|
||||
int i = GetSelection() ;
|
||||
event.SetInt( i );
|
||||
event.SetString( GetString( i ) );
|
||||
event.SetInt(i);
|
||||
event.SetString(GetString(i));
|
||||
event.SetEventObject( this );
|
||||
ProcessCommand( event );
|
||||
ProcessCommand(event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ bool wxRadioBox::Create( wxWindow *parent,
|
||||
|
||||
int i;
|
||||
|
||||
m_noItems = (size_t)n;
|
||||
m_noItems = (unsigned int)n;
|
||||
m_noRowsOrCols = majorDim;
|
||||
m_radioButtonCycle = NULL;
|
||||
|
||||
@ -150,7 +150,7 @@ bool wxRadioBox::Enable(bool enable)
|
||||
return false;
|
||||
|
||||
current = m_radioButtonCycle;
|
||||
for (size_t i = 0; i < m_noItems; i++)
|
||||
for (unsigned int i = 0; i < m_noItems; i++)
|
||||
{
|
||||
current->Enable( enable );
|
||||
current = current->NextInCycle();
|
||||
@ -161,16 +161,13 @@ bool wxRadioBox::Enable(bool enable)
|
||||
|
||||
// Enables or disables an given button
|
||||
//
|
||||
bool wxRadioBox::Enable(int item, bool enable)
|
||||
bool wxRadioBox::Enable(unsigned int item, bool enable)
|
||||
{
|
||||
int i;
|
||||
wxRadioButton *current;
|
||||
|
||||
if (!IsValid( item ))
|
||||
return false;
|
||||
|
||||
i = 0;
|
||||
current = m_radioButtonCycle;
|
||||
unsigned int i = 0;
|
||||
wxRadioButton *current = m_radioButtonCycle;
|
||||
while (i != item)
|
||||
{
|
||||
i++;
|
||||
@ -189,15 +186,14 @@ wxString wxRadioBox::GetLabel() const
|
||||
|
||||
// Returns the label for the given button
|
||||
//
|
||||
wxString wxRadioBox::GetString(int item) const
|
||||
wxString wxRadioBox::GetString(unsigned int item) const
|
||||
{
|
||||
int i;
|
||||
wxRadioButton *current;
|
||||
|
||||
if (!IsValid( item ))
|
||||
return wxEmptyString;
|
||||
|
||||
i = 0;
|
||||
unsigned int i = 0;
|
||||
current = m_radioButtonCycle;
|
||||
while (i != item)
|
||||
{
|
||||
@ -235,16 +231,13 @@ void wxRadioBox::SetLabel(const wxString& label)
|
||||
|
||||
// Sets the label of a given button
|
||||
//
|
||||
void wxRadioBox::SetString(int item,const wxString& label)
|
||||
void wxRadioBox::SetString(unsigned int item,const wxString& label)
|
||||
{
|
||||
int i;
|
||||
wxRadioButton *current;
|
||||
|
||||
if (!IsValid( item ))
|
||||
return;
|
||||
|
||||
i = 0;
|
||||
current = m_radioButtonCycle;
|
||||
unsigned int i = 0;
|
||||
wxRadioButton *current = m_radioButtonCycle;
|
||||
while (i != item)
|
||||
{
|
||||
i++;
|
||||
@ -283,7 +276,7 @@ bool wxRadioBox::Show(bool show)
|
||||
wxRadioButton *current;
|
||||
|
||||
current = m_radioButtonCycle;
|
||||
for (size_t i=0; i<m_noItems; i++)
|
||||
for (unsigned int i=0; i<m_noItems; i++)
|
||||
{
|
||||
current->Show( show );
|
||||
current = current->NextInCycle();
|
||||
@ -296,16 +289,13 @@ bool wxRadioBox::Show(bool show)
|
||||
|
||||
// Shows or hides the given button
|
||||
//
|
||||
bool wxRadioBox::Show(int item, bool show)
|
||||
bool wxRadioBox::Show(unsigned int item, bool show)
|
||||
{
|
||||
int i;
|
||||
wxRadioButton *current;
|
||||
|
||||
if (!IsValid( item ))
|
||||
return false;
|
||||
|
||||
i = 0;
|
||||
current = m_radioButtonCycle;
|
||||
unsigned int i = 0;
|
||||
wxRadioButton *current = m_radioButtonCycle;
|
||||
while (i != item)
|
||||
{
|
||||
i++;
|
||||
@ -383,9 +373,9 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
|
||||
maxWidth = -1;
|
||||
maxHeight = -1;
|
||||
for (size_t i = 0 ; i < m_noItems; i++)
|
||||
for (unsigned int i = 0 ; i < m_noItems; i++)
|
||||
{
|
||||
GetTextExtent( GetString( i ), &eachWidth[i], &eachHeight[i] );
|
||||
GetTextExtent(GetString(i), &eachWidth[i], &eachHeight[i] );
|
||||
eachWidth[i] = (int)(eachWidth[i] + RADIO_SIZE);
|
||||
eachHeight[i] = (int)((3 * eachHeight[i]) / 2);
|
||||
|
||||
@ -473,9 +463,9 @@ wxSize wxRadioBox::DoGetBestSize() const
|
||||
maxWidth = -1;
|
||||
maxHeight = -1;
|
||||
|
||||
for (size_t i = 0 ; i < m_noItems; i++)
|
||||
for (unsigned int i = 0 ; i < m_noItems; i++)
|
||||
{
|
||||
GetTextExtent( GetString( i ), &eachWidth, &eachHeight, NULL, NULL, &font );
|
||||
GetTextExtent(GetString(i), &eachWidth, &eachHeight, NULL, NULL, &font );
|
||||
eachWidth = (int)(eachWidth + RADIO_SIZE);
|
||||
eachHeight = (int)((3 * eachHeight) / 2);
|
||||
if (maxWidth < eachWidth)
|
||||
|
@ -310,7 +310,7 @@ bool wxCheckListBox::Create(wxWindow *parent,
|
||||
// wxCheckListBox functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxCheckListBox::IsChecked(size_t item) const
|
||||
bool wxCheckListBox::IsChecked(unsigned int item) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid(item), false,
|
||||
_T("invalid index in wxCheckListBox::IsChecked") );
|
||||
@ -318,7 +318,7 @@ bool wxCheckListBox::IsChecked(size_t item) const
|
||||
return m_checks[item] != 0;
|
||||
}
|
||||
|
||||
void wxCheckListBox::Check(size_t item, bool check)
|
||||
void wxCheckListBox::Check(unsigned int item, bool check)
|
||||
{
|
||||
wxCHECK_RET( IsValid(item),
|
||||
_T("invalid index in wxCheckListBox::Check") );
|
||||
@ -337,7 +337,7 @@ void wxCheckListBox::Check(size_t item, bool check)
|
||||
// methods forwarded to wxListBox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxCheckListBox::Delete(int n)
|
||||
void wxCheckListBox::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n), _T("invalid index in wxListBox::Delete") );
|
||||
|
||||
@ -358,12 +358,12 @@ int wxCheckListBox::DoAppend(const wxString& item)
|
||||
return pos;
|
||||
}
|
||||
|
||||
void wxCheckListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
void wxCheckListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
|
||||
{
|
||||
wxListBox::DoInsertItems(items, pos);
|
||||
|
||||
size_t count = items.GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = items.GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
m_checks.Insert(false, pos + n);
|
||||
}
|
||||
@ -374,8 +374,8 @@ void wxCheckListBox::DoSetItems(const wxArrayString& items, void **clientData)
|
||||
// call it first as it does DoClear()
|
||||
wxListBox::DoSetItems(items, clientData);
|
||||
|
||||
size_t count = items.GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = items.GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
m_checks.Add(false);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ wxChoice::~wxChoice()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
size_t i, max = GetCount();
|
||||
unsigned int i, max = GetCount();
|
||||
|
||||
for ( i = 0; i < max; ++i )
|
||||
delete GetClientObject(i);
|
||||
@ -96,7 +96,7 @@ int wxChoice::DoAppend(const wxString& item)
|
||||
return index ;
|
||||
}
|
||||
|
||||
int wxChoice::DoInsert(const wxString& item, int pos)
|
||||
int wxChoice::DoInsert(const wxString& item, unsigned int pos)
|
||||
{
|
||||
wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list"));
|
||||
wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index"));
|
||||
@ -112,7 +112,7 @@ int wxChoice::DoInsert(const wxString& item, int pos)
|
||||
return pos ;
|
||||
}
|
||||
|
||||
void wxChoice::Delete(int n)
|
||||
void wxChoice::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n), wxT("invalid item index in wxChoice::Delete") );
|
||||
if ( HasClientObjectData() )
|
||||
@ -128,7 +128,7 @@ void wxChoice::Delete(int n)
|
||||
void wxChoice::Clear()
|
||||
{
|
||||
FreeData();
|
||||
for ( int i = 0 ; i < GetCount() ; i++ )
|
||||
for ( unsigned int i = 0 ; i < GetCount() ; i++ )
|
||||
{
|
||||
::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , 1 ) ;
|
||||
}
|
||||
@ -141,8 +141,8 @@ void wxChoice::FreeData()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
size_t count = GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
delete GetClientObject(n);
|
||||
}
|
||||
@ -166,12 +166,12 @@ void wxChoice::SetSelection(int n)
|
||||
// string list functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
size_t wxChoice::GetCount() const
|
||||
unsigned int wxChoice::GetCount() const
|
||||
{
|
||||
return m_strings.GetCount() ;
|
||||
}
|
||||
|
||||
void wxChoice::SetString(int n, const wxString& s)
|
||||
void wxChoice::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
wxFAIL_MSG(wxT("wxChoice::SetString() not yet implemented"));
|
||||
#if 0 // should do this, but no Insert() so far
|
||||
@ -180,7 +180,7 @@ void wxChoice::SetString(int n, const wxString& s)
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString wxChoice::GetString(int n) const
|
||||
wxString wxChoice::GetString(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid(n), wxEmptyString,
|
||||
_T("wxChoice::GetString(): invalid index") );
|
||||
@ -191,27 +191,27 @@ wxString wxChoice::GetString(int n) const
|
||||
// ----------------------------------------------------------------------------
|
||||
// client data
|
||||
// ----------------------------------------------------------------------------
|
||||
void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
void wxChoice::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
wxCHECK_RET( n >= 0 && (size_t)n < m_datas.GetCount(),
|
||||
wxCHECK_RET( n >= 0 && (unsigned int)n < m_datas.GetCount(),
|
||||
wxT("invalid index in wxChoice::SetClientData") );
|
||||
|
||||
m_datas[n] = (char*) clientData ;
|
||||
}
|
||||
|
||||
void *wxChoice::DoGetItemClientData(int n) const
|
||||
void *wxChoice::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( n >= 0 && (size_t)n < m_datas.GetCount(), NULL,
|
||||
wxCHECK_MSG( n >= 0 && (unsigned int)n < m_datas.GetCount(), NULL,
|
||||
wxT("invalid index in wxChoice::GetClientData") );
|
||||
return (void *)m_datas[n];
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
void wxChoice::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
DoSetItemClientData(n, clientData);
|
||||
}
|
||||
|
||||
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
wxClientData* wxChoice::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return (wxClientData *)DoGetItemClientData(n);
|
||||
}
|
||||
@ -259,7 +259,7 @@ wxSize wxChoice::DoGetBestSize() const
|
||||
::TextFace( 0 ) ;
|
||||
}
|
||||
// Find the widest line
|
||||
for(int i = 0; i < GetCount(); i++) {
|
||||
for(unsigned int i = 0; i < GetCount(); i++) {
|
||||
wxString str(GetString(i));
|
||||
#if wxUSE_UNICODE
|
||||
Point bounds={0,0} ;
|
||||
|
@ -134,7 +134,7 @@ public:
|
||||
protected:
|
||||
void OnChoice( wxCommandEvent& e )
|
||||
{
|
||||
wxString s = e.GetString();
|
||||
wxString s = e.GetString();
|
||||
|
||||
m_cb->DelegateChoice( s );
|
||||
wxCommandEvent event2(wxEVT_COMMAND_COMBOBOX_SELECTED, m_cb->GetId() );
|
||||
@ -308,7 +308,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
wxString wxComboBox::GetValue() const
|
||||
{
|
||||
wxString result;
|
||||
wxString result;
|
||||
|
||||
if ( m_text == NULL )
|
||||
{
|
||||
@ -420,27 +420,27 @@ int wxComboBox::DoAppend(const wxString& item)
|
||||
return m_choice->DoAppend( item ) ;
|
||||
}
|
||||
|
||||
int wxComboBox::DoInsert(const wxString& item, int pos)
|
||||
int wxComboBox::DoInsert(const wxString& item, unsigned int pos)
|
||||
{
|
||||
return m_choice->DoInsert( item , pos ) ;
|
||||
}
|
||||
|
||||
void wxComboBox::DoSetItemClientData(int n, void* clientData)
|
||||
void wxComboBox::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
return m_choice->DoSetItemClientData( n , clientData ) ;
|
||||
}
|
||||
|
||||
void* wxComboBox::DoGetItemClientData(int n) const
|
||||
void* wxComboBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
return m_choice->DoGetItemClientData( n ) ;
|
||||
}
|
||||
|
||||
void wxComboBox::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||
void wxComboBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
return m_choice->DoSetItemClientObject( n , clientData ) ;
|
||||
return m_choice->DoSetItemClientObject(n , clientData);
|
||||
}
|
||||
|
||||
wxClientData* wxComboBox::DoGetItemClientObject(int n) const
|
||||
wxClientData* wxComboBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return m_choice->DoGetItemClientObject( n ) ;
|
||||
}
|
||||
@ -449,15 +449,15 @@ void wxComboBox::FreeData()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
size_t count = GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
SetClientObject( n, NULL );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxComboBox::Delete(int n)
|
||||
void wxComboBox::Delete(unsigned int n)
|
||||
{
|
||||
// force client object deletion
|
||||
if( HasClientObjectData() )
|
||||
@ -482,7 +482,7 @@ void wxComboBox::SetSelection(int n)
|
||||
|
||||
if ( m_text != NULL )
|
||||
{
|
||||
m_text->SetValue( GetString( n ) );
|
||||
m_text->SetValue(GetString(n));
|
||||
}
|
||||
}
|
||||
|
||||
@ -491,7 +491,7 @@ int wxComboBox::FindString(const wxString& s, bool bCase ) const
|
||||
return m_choice->FindString( s , bCase );
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetString(int n) const
|
||||
wxString wxComboBox::GetString(unsigned int n) const
|
||||
{
|
||||
return m_choice->GetString( n );
|
||||
}
|
||||
@ -499,15 +499,16 @@ wxString wxComboBox::GetString(int n) const
|
||||
wxString wxComboBox::GetStringSelection() const
|
||||
{
|
||||
int sel = GetSelection ();
|
||||
if (sel > -1)
|
||||
return wxString(this->GetString (sel));
|
||||
|
||||
if (sel != wxNOT_FOUND)
|
||||
return wxString(this->GetString((unsigned int)sel));
|
||||
else
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(int n, const wxString& s)
|
||||
void wxComboBox::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
m_choice->SetString( n , s ) ;
|
||||
m_choice->SetString( n , s );
|
||||
}
|
||||
|
||||
bool wxComboBox::IsEditable() const
|
||||
|
@ -343,7 +343,7 @@ void wxListBox::FreeData()
|
||||
#endif // wxUSE_OWNER_DRAWN
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
for ( size_t n = 0; n < m_noItems; n++ )
|
||||
for ( unsigned int n = 0; n < m_noItems; n++ )
|
||||
{
|
||||
delete GetClientObject(n);
|
||||
}
|
||||
@ -376,32 +376,32 @@ void wxListBox::DoSetFirstItem(int N)
|
||||
MacScrollTo( N ) ;
|
||||
}
|
||||
|
||||
void wxListBox::Delete(int N)
|
||||
void wxListBox::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( IsValid(N),
|
||||
wxCHECK_RET( IsValid(n),
|
||||
wxT("invalid index in wxListBox::Delete") );
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
delete m_aItems[N];
|
||||
m_aItems.RemoveAt(N);
|
||||
delete m_aItems[n];
|
||||
m_aItems.RemoveAt(n);
|
||||
#else // !wxUSE_OWNER_DRAWN
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
delete GetClientObject(N);
|
||||
delete GetClientObject(n);
|
||||
}
|
||||
#endif // wxUSE_OWNER_DRAWN/!wxUSE_OWNER_DRAWN
|
||||
m_stringArray.RemoveAt( N ) ;
|
||||
m_dataArray.RemoveAt( N ) ;
|
||||
m_noItems --;
|
||||
m_stringArray.RemoveAt(n) ;
|
||||
m_dataArray.RemoveAt(n) ;
|
||||
m_noItems--;
|
||||
|
||||
MacDelete( N ) ;
|
||||
MacDelete(n) ;
|
||||
}
|
||||
|
||||
int wxListBox::DoAppend(const wxString& item)
|
||||
{
|
||||
InvalidateBestSize();
|
||||
|
||||
size_t index = m_noItems ;
|
||||
unsigned int index = m_noItems ;
|
||||
m_stringArray.Add( item ) ;
|
||||
m_dataArray.Add( NULL );
|
||||
m_noItems ++;
|
||||
@ -435,7 +435,7 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
if ( m_windowStyle & wxLB_OWNERDRAW ) {
|
||||
// first delete old items
|
||||
size_t ui = m_aItems.Count();
|
||||
unsigned int ui = m_aItems.Count();
|
||||
while ( ui-- != 0 ) {
|
||||
delete m_aItems[ui];
|
||||
m_aItems[ui] = NULL;
|
||||
@ -467,7 +467,7 @@ int wxListBox::FindString(const wxString& s, bool bCase) const
|
||||
Str255 s1 , s2 ;
|
||||
wxMacStringToPascal( search , s2 ) ;
|
||||
|
||||
for ( size_t i = 0 ; i < m_noItems ; ++ i )
|
||||
for ( unsigned int i = 0 ; i < m_noItems ; ++ i )
|
||||
{
|
||||
wxMacStringToPascal( m_stringArray[i].Left( len ) , s1 ) ;
|
||||
|
||||
@ -478,9 +478,9 @@ int wxListBox::FindString(const wxString& s, bool bCase) const
|
||||
{
|
||||
wxString st = s ;
|
||||
st.MakeLower() ;
|
||||
for ( size_t i = 0 ; i < m_noItems ; ++i )
|
||||
for ( unsigned int i = 0 ; i < m_noItems ; ++i )
|
||||
{
|
||||
if ( GetString(i).Lower().Matches(st) )
|
||||
if (GetString(i).Lower().Matches(st))
|
||||
return (int)i ;
|
||||
}
|
||||
}
|
||||
@ -492,7 +492,7 @@ int wxListBox::FindString(const wxString& s, bool bCase) const
|
||||
|
||||
wxMacStringToPascal( s , s2 ) ;
|
||||
|
||||
for ( size_t i = 0 ; i < m_noItems ; ++ i )
|
||||
for ( unsigned int i = 0 ; i < m_noItems ; ++ i )
|
||||
{
|
||||
wxMacStringToPascal( m_stringArray[i] , s1 ) ;
|
||||
|
||||
@ -529,22 +529,22 @@ bool wxListBox::IsSelected(int N) const
|
||||
return MacIsSelected( N ) ;
|
||||
}
|
||||
|
||||
void *wxListBox::DoGetItemClientData(int N) const
|
||||
void *wxListBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid(N), NULL,
|
||||
wxCHECK_MSG( IsValid(n), NULL,
|
||||
wxT("invalid index in wxListBox::GetClientData"));
|
||||
|
||||
return (void *)m_dataArray[N];
|
||||
return (void *)m_dataArray[n];
|
||||
}
|
||||
|
||||
wxClientData *wxListBox::DoGetItemClientObject(int N) const
|
||||
wxClientData *wxListBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return (wxClientData *) DoGetItemClientData( N ) ;
|
||||
return (wxClientData *) DoGetItemClientData( n ) ;
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientData(int N, void *Client_data)
|
||||
void wxListBox::DoSetItemClientData(unsigned int n, void *Client_data)
|
||||
{
|
||||
wxCHECK_RET( IsValid(N),
|
||||
wxCHECK_RET( IsValid(n),
|
||||
wxT("invalid index in wxListBox::SetClientData") );
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
@ -555,11 +555,11 @@ void wxListBox::DoSetItemClientData(int N, void *Client_data)
|
||||
wxFAIL_MSG(wxT("Can't use client data with owner-drawn listboxes"));
|
||||
}
|
||||
#endif // wxUSE_OWNER_DRAWN
|
||||
wxASSERT_MSG( m_dataArray.GetCount() >= (size_t) N , wxT("invalid client_data array") ) ;
|
||||
wxASSERT_MSG( m_dataArray.GetCount() >= (unsigned int) n , wxT("invalid client_data array") ) ;
|
||||
|
||||
if ( m_dataArray.GetCount() > (size_t) N )
|
||||
if ( m_dataArray.GetCount() > (size_t) n )
|
||||
{
|
||||
m_dataArray[N] = (char*) Client_data ;
|
||||
m_dataArray[n] = (char*) Client_data ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -567,7 +567,7 @@ void wxListBox::DoSetItemClientData(int N, void *Client_data)
|
||||
}
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||
void wxListBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
DoSetItemClientData(n, clientData);
|
||||
}
|
||||
@ -585,21 +585,21 @@ int wxListBox::GetSelection() const
|
||||
}
|
||||
|
||||
// Find string for position
|
||||
wxString wxListBox::GetString(int N) const
|
||||
wxString wxListBox::GetString(unsigned int n) const
|
||||
{
|
||||
return m_stringArray[N] ;
|
||||
return m_stringArray[n] ;
|
||||
}
|
||||
|
||||
void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
void wxListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
|
||||
{
|
||||
wxCHECK_RET( IsValidInsert(pos),
|
||||
wxT("invalid index in wxListBox::InsertItems") );
|
||||
|
||||
InvalidateBestSize();
|
||||
|
||||
size_t nItems = items.GetCount();
|
||||
unsigned int nItems = items.GetCount();
|
||||
|
||||
for ( size_t i = 0 ; i < nItems ; i++ )
|
||||
for ( unsigned int i = 0 ; i < nItems ; i++ )
|
||||
{
|
||||
m_stringArray.Insert( items[i] , pos + i ) ;
|
||||
m_dataArray.Insert( NULL , pos + i ) ;
|
||||
@ -609,10 +609,10 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
m_noItems += nItems;
|
||||
}
|
||||
|
||||
void wxListBox::SetString(int N, const wxString& s)
|
||||
void wxListBox::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
m_stringArray[N] = s ;
|
||||
MacSet( N , s ) ;
|
||||
m_stringArray[n] = s;
|
||||
MacSet(n, s);
|
||||
}
|
||||
|
||||
wxSize wxListBox::DoGetBestSize() const
|
||||
@ -638,7 +638,7 @@ wxSize wxListBox::DoGetBestSize() const
|
||||
}
|
||||
|
||||
// Find the widest line
|
||||
for(int i = 0; i < GetCount(); i++) {
|
||||
for(unsigned int i = 0; i < GetCount(); i++) {
|
||||
wxString str(GetString(i));
|
||||
#if wxUSE_UNICODE
|
||||
Point bounds={0,0} ;
|
||||
@ -671,7 +671,7 @@ wxSize wxListBox::DoGetBestSize() const
|
||||
return wxSize(lbWidth, lbHeight);
|
||||
}
|
||||
|
||||
size_t wxListBox::GetCount() const
|
||||
unsigned int wxListBox::GetCount() const
|
||||
{
|
||||
return m_noItems;
|
||||
}
|
||||
@ -899,7 +899,7 @@ void wxListBox::MacDoClick()
|
||||
event.SetClientObject( GetClientObject(n) );
|
||||
else if ( HasClientUntypedData() )
|
||||
event.SetClientData( GetClientData(n) );
|
||||
event.SetString( GetString(n) );
|
||||
event.SetString(GetString(n));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -980,7 +980,7 @@ void wxListBox::OnChar(wxKeyEvent& event)
|
||||
event.SetClientObject( GetClientObject(n) );
|
||||
else if ( HasClientUntypedData() )
|
||||
event.SetClientData( GetClientData(n) );
|
||||
event.SetString( GetString(n) );
|
||||
event.SetString(GetString(n));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1012,7 +1012,7 @@ void wxListBox::OnChar(wxKeyEvent& event)
|
||||
event.SetClientObject( GetClientObject( line ) );
|
||||
else if ( HasClientUntypedData() )
|
||||
event.SetClientData( GetClientData(line) );
|
||||
event.SetString( GetString(line) );
|
||||
event.SetString(GetString(line));
|
||||
|
||||
event.SetInt(line);
|
||||
|
||||
|
@ -39,7 +39,7 @@ void wxRadioBox::OnRadioButton( wxCommandEvent &outer )
|
||||
wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId);
|
||||
int i = GetSelection() ;
|
||||
event.SetInt( i );
|
||||
event.SetString( GetString( i ) );
|
||||
event.SetString(GetString(i));
|
||||
event.SetEventObject( this );
|
||||
ProcessCommand(event);
|
||||
}
|
||||
@ -111,7 +111,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
|
||||
int i;
|
||||
|
||||
m_noItems = (size_t)n;
|
||||
m_noItems = (unsigned int)n;
|
||||
m_noRowsOrCols = majorDim;
|
||||
m_radioButtonCycle = NULL;
|
||||
|
||||
@ -155,13 +155,12 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
|
||||
bool wxRadioBox::Enable(bool enable)
|
||||
{
|
||||
wxRadioButton *current;
|
||||
|
||||
if (!wxControl::Enable(enable))
|
||||
return false;
|
||||
|
||||
current = m_radioButtonCycle;
|
||||
for (size_t i = 0; i < m_noItems; i++) {
|
||||
wxRadioButton *current = m_radioButtonCycle;
|
||||
for (unsigned int i = 0; i < m_noItems; i++)
|
||||
{
|
||||
current->Enable(enable);
|
||||
current = current->NextInCycle();
|
||||
}
|
||||
@ -169,21 +168,19 @@ bool wxRadioBox::Enable(bool enable)
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// ¥ Enable(int, bool)
|
||||
// ¥ Enable(unsigned int, bool)
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Enables or disables an given button
|
||||
|
||||
bool wxRadioBox::Enable(int item, bool enable)
|
||||
bool wxRadioBox::Enable(unsigned int item, bool enable)
|
||||
{
|
||||
int i;
|
||||
wxRadioButton *current;
|
||||
|
||||
if (!IsValid(item))
|
||||
return false;
|
||||
|
||||
i = 0;
|
||||
current = m_radioButtonCycle;
|
||||
while (i != item) {
|
||||
unsigned int i = 0;
|
||||
wxRadioButton *current = m_radioButtonCycle;
|
||||
while (i != item)
|
||||
{
|
||||
i++;
|
||||
current = current->NextInCycle();
|
||||
}
|
||||
@ -205,15 +202,14 @@ wxString wxRadioBox::GetLabel() const
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Returns the label for the given button
|
||||
|
||||
wxString wxRadioBox::GetString(int item) const
|
||||
wxString wxRadioBox::GetString(unsigned int item) const
|
||||
{
|
||||
int i;
|
||||
wxRadioButton *current;
|
||||
|
||||
if (!IsValid(item))
|
||||
return wxEmptyString;
|
||||
|
||||
i = 0;
|
||||
unsigned int i = 0;
|
||||
current = m_radioButtonCycle;
|
||||
while (i != item) {
|
||||
i++;
|
||||
@ -265,16 +261,15 @@ void wxRadioBox::SetLabel(const wxString& label)
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Sets the label of a given button
|
||||
|
||||
void wxRadioBox::SetString(int item,const wxString& label)
|
||||
void wxRadioBox::SetString(unsigned int item,const wxString& label)
|
||||
{
|
||||
int i;
|
||||
wxRadioButton *current;
|
||||
|
||||
if (!IsValid(item))
|
||||
return;
|
||||
i=0;
|
||||
current=m_radioButtonCycle;
|
||||
while (i!=item) {
|
||||
|
||||
unsigned int i=0;
|
||||
wxRadioButton *current=m_radioButtonCycle;
|
||||
while (i!=item)
|
||||
{
|
||||
i++;
|
||||
current=current->NextInCycle();
|
||||
}
|
||||
@ -316,7 +311,7 @@ bool wxRadioBox::Show(bool show)
|
||||
wxControl::Show(show);
|
||||
|
||||
current=m_radioButtonCycle;
|
||||
for (size_t i=0; i<m_noItems; i++)
|
||||
for (unsigned int i=0; i<m_noItems; i++)
|
||||
{
|
||||
current->Show(show);
|
||||
current=current->NextInCycle();
|
||||
@ -325,19 +320,17 @@ bool wxRadioBox::Show(bool show)
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// ¥ Show(int, bool)
|
||||
// ¥ Show(unsigned int, bool)
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Shows or hides the given button
|
||||
|
||||
bool wxRadioBox::Show(int item, bool show)
|
||||
bool wxRadioBox::Show(unsigned int item, bool show)
|
||||
{
|
||||
int i;
|
||||
wxRadioButton *current;
|
||||
|
||||
if (!IsValid(item))
|
||||
return false;
|
||||
i=0;
|
||||
current=m_radioButtonCycle;
|
||||
|
||||
unsigned int i = 0;
|
||||
wxRadioButton *current=m_radioButtonCycle;
|
||||
while (i!=item) {
|
||||
i++;
|
||||
current=current->NextInCycle();
|
||||
@ -385,7 +378,7 @@ void wxRadioBox::SetFocus()
|
||||
|
||||
void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
size_t i;
|
||||
unsigned int i;
|
||||
wxRadioButton *current;
|
||||
|
||||
// define the position
|
||||
@ -504,7 +497,7 @@ wxSize wxRadioBox::DoGetBestSize() const
|
||||
maxWidth = -1;
|
||||
maxHeight = -1;
|
||||
|
||||
for (size_t i = 0 ; i < m_noItems; i++)
|
||||
for (unsigned int i = 0 ; i < m_noItems; i++)
|
||||
{
|
||||
GetTextExtent(GetString(i), &eachWidth, &eachHeight);
|
||||
eachWidth = (int)(eachWidth + RADIO_SIZE) ;
|
||||
|
@ -16,6 +16,8 @@
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if wxUSE_CHECKLISTBOX
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#include "wx/checklst.h"
|
||||
@ -116,12 +118,12 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
// check items
|
||||
// -----------
|
||||
|
||||
bool wxCheckListBox::IsChecked(size_t uiIndex) const
|
||||
bool wxCheckListBox::IsChecked(unsigned int uiIndex) const
|
||||
{
|
||||
return ::IsChecked(wxListBox::GetString(uiIndex));
|
||||
}
|
||||
|
||||
void wxCheckListBox::Check(size_t uiIndex, bool bCheck)
|
||||
void wxCheckListBox::Check(unsigned int uiIndex, bool bCheck)
|
||||
{
|
||||
wxString label = wxListBox::GetString(uiIndex);
|
||||
if(::IsChecked(label) == bCheck) return;
|
||||
@ -145,7 +147,7 @@ void wxCheckListBox::DoToggleItem( int n, int x )
|
||||
event.SetInt(n);
|
||||
event.SetExtraLong(true);
|
||||
event.SetEventObject(this);
|
||||
event.SetString( GetString( n ) );
|
||||
event.SetString(GetString(n));
|
||||
|
||||
GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
@ -170,17 +172,17 @@ int wxCheckListBox::FindString(const wxString& s, bool bCase) const
|
||||
return min;
|
||||
}
|
||||
|
||||
void wxCheckListBox::SetString(int n, const wxString& s)
|
||||
void wxCheckListBox::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
wxListBox::SetString( n, Prefix(IsChecked(n)) + s );
|
||||
wxListBox::SetString(n, Prefix(IsChecked(n)) + s);
|
||||
}
|
||||
|
||||
wxString wxCheckListBox::GetString(int n) const
|
||||
wxString wxCheckListBox::GetString(unsigned int n) const
|
||||
{
|
||||
return wxListBox::GetString(n).substr(4);
|
||||
}
|
||||
|
||||
void wxCheckListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
void wxCheckListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
|
||||
{
|
||||
wxArrayString copy;
|
||||
CopyStringsAddingPrefix(items, copy);
|
||||
@ -193,3 +195,5 @@ void wxCheckListBox::DoSetItems(const wxArrayString& items, void **clientData)
|
||||
CopyStringsAddingPrefix(items, copy);
|
||||
wxListBox::DoSetItems(copy, clientData);
|
||||
}
|
||||
|
||||
#endif // wxUSE_CHECKLISTBOX
|
||||
|
@ -187,10 +187,10 @@ static inline wxChar* MYcopystring(const wxChar* s)
|
||||
return wxStrcpy(copy, s);
|
||||
}
|
||||
|
||||
int wxChoice::DoInsert(const wxString& item, int pos)
|
||||
int wxChoice::DoInsert(const wxString& item, unsigned int pos)
|
||||
{
|
||||
#ifndef XmNpositionIndex
|
||||
wxCHECK_MSG( (size_t)pos == GetCount(), -1, wxT("insert not implemented"));
|
||||
wxCHECK_MSG( pos == GetCount(), -1, wxT("insert not implemented"));
|
||||
#endif
|
||||
Widget w = XtVaCreateManagedWidget (wxStripMenuCodes(item),
|
||||
#if wxUSE_GADGETS
|
||||
@ -236,10 +236,10 @@ int wxChoice::DoInsert(const wxString& item, int pos)
|
||||
|
||||
int wxChoice::DoAppend(const wxString& item)
|
||||
{
|
||||
return DoInsert(item, (int)GetCount());
|
||||
return DoInsert(item, GetCount());
|
||||
}
|
||||
|
||||
void wxChoice::Delete(int n)
|
||||
void wxChoice::Delete(unsigned int n)
|
||||
{
|
||||
Widget w = (Widget)m_widgetArray[n];
|
||||
XtRemoveCallback(w, XmNactivateCallback, (XtCallbackProc)wxChoiceCallback,
|
||||
@ -249,13 +249,13 @@ void wxChoice::Delete(int n)
|
||||
m_clientDataDict.Delete(n, HasClientObjectData());
|
||||
|
||||
XtDestroyWidget(w);
|
||||
m_noStrings --;
|
||||
m_noStrings--;
|
||||
}
|
||||
|
||||
void wxChoice::Clear()
|
||||
{
|
||||
m_stringList.Clear ();
|
||||
size_t i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < m_noStrings; i++)
|
||||
{
|
||||
XtRemoveCallback((Widget) m_widgetArray[i],
|
||||
@ -337,7 +337,7 @@ void wxChoice::SetSelection(int n)
|
||||
m_inSetValue = false;
|
||||
}
|
||||
|
||||
wxString wxChoice::GetString(int n) const
|
||||
wxString wxChoice::GetString(unsigned int n) const
|
||||
{
|
||||
wxStringList::compatibility_iterator node = m_stringList.Item(n);
|
||||
if (node)
|
||||
@ -384,7 +384,7 @@ void wxChoice::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
|
||||
if (width > -1)
|
||||
{
|
||||
size_t i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < m_noStrings; i++)
|
||||
XtVaSetValues ((Widget) m_widgetArray[i],
|
||||
XmNwidth, actualWidth,
|
||||
@ -395,7 +395,7 @@ void wxChoice::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
if (height > -1)
|
||||
{
|
||||
#if 0
|
||||
size_t i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < m_noStrings; i++)
|
||||
XtVaSetValues ((Widget) m_widgetArray[i],
|
||||
XmNheight, actualHeight,
|
||||
@ -462,7 +462,7 @@ void wxChoice::ChangeFont(bool keepOriginalSize)
|
||||
fontTag, m_font.GetFontTypeC(dpy),
|
||||
NULL);
|
||||
|
||||
for( size_t i = 0; i < m_noStrings; ++i )
|
||||
for( unsigned int i = 0; i < m_noStrings; ++i )
|
||||
XtVaSetValues( (Widget)m_widgetArray[i],
|
||||
fontTag, m_font.GetFontTypeC(dpy),
|
||||
NULL );
|
||||
@ -480,7 +480,7 @@ void wxChoice::ChangeBackgroundColour()
|
||||
wxDoChangeBackgroundColour(m_formWidget, m_backgroundColour);
|
||||
wxDoChangeBackgroundColour(m_buttonWidget, m_backgroundColour);
|
||||
wxDoChangeBackgroundColour(m_menuWidget, m_backgroundColour);
|
||||
size_t i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < m_noStrings; i++)
|
||||
wxDoChangeBackgroundColour(m_widgetArray[i], m_backgroundColour);
|
||||
}
|
||||
@ -490,38 +490,38 @@ void wxChoice::ChangeForegroundColour()
|
||||
wxDoChangeForegroundColour(m_formWidget, m_foregroundColour);
|
||||
wxDoChangeForegroundColour(m_buttonWidget, m_foregroundColour);
|
||||
wxDoChangeForegroundColour(m_menuWidget, m_foregroundColour);
|
||||
size_t i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < m_noStrings; i++)
|
||||
wxDoChangeForegroundColour(m_widgetArray[i], m_foregroundColour);
|
||||
}
|
||||
|
||||
size_t wxChoice::GetCount() const
|
||||
unsigned int wxChoice::GetCount() const
|
||||
{
|
||||
return m_noStrings;
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientData(int n, void* clientData)
|
||||
void wxChoice::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
m_clientDataDict.Set(n, (wxClientData*)clientData, false);
|
||||
}
|
||||
|
||||
void* wxChoice::DoGetItemClientData(int n) const
|
||||
void* wxChoice::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
return (void*)m_clientDataDict.Get(n);
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||
void wxChoice::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
// don't delete, wxItemContainer does that for us
|
||||
m_clientDataDict.Set(n, clientData, false);
|
||||
}
|
||||
|
||||
wxClientData* wxChoice::DoGetItemClientObject(int n) const
|
||||
wxClientData* wxChoice::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return m_clientDataDict.Get(n);
|
||||
}
|
||||
|
||||
void wxChoice::SetString(int WXUNUSED(n), const wxString& WXUNUSED(s))
|
||||
void wxChoice::SetString(unsigned int WXUNUSED(n), const wxString& WXUNUSED(s))
|
||||
{
|
||||
wxFAIL_MSG( wxT("wxChoice::SetString not implemented") );
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
if( !CreateControl( parent, id, pos, size, style, validator, name ) )
|
||||
return false;
|
||||
|
||||
m_noStrings = (size_t)n;
|
||||
m_noStrings = n;
|
||||
|
||||
Widget parentWidget = (Widget) parent->GetClientWidget();
|
||||
|
||||
@ -144,7 +144,7 @@ void wxComboBox::SetValue(const wxString& value)
|
||||
m_inSetValue = false;
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(int WXUNUSED(n), const wxString& WXUNUSED(s))
|
||||
void wxComboBox::SetString(unsigned int WXUNUSED(n), const wxString& WXUNUSED(s))
|
||||
{
|
||||
wxFAIL_MSG( wxT("wxComboBox::SetString only implemented for Motif 2.0") );
|
||||
}
|
||||
@ -159,7 +159,7 @@ int wxComboBox::DoAppend(const wxString& item)
|
||||
return GetCount() - 1;
|
||||
}
|
||||
|
||||
int wxComboBox::DoInsert(const wxString& item, int pos)
|
||||
int wxComboBox::DoInsert(const wxString& item, unsigned int pos)
|
||||
{
|
||||
wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list"));
|
||||
wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index"));
|
||||
@ -176,7 +176,7 @@ int wxComboBox::DoInsert(const wxString& item, int pos)
|
||||
return pos;
|
||||
}
|
||||
|
||||
void wxComboBox::Delete(int n)
|
||||
void wxComboBox::Delete(unsigned int n)
|
||||
{
|
||||
XmComboBoxDeletePos((Widget) m_mainWidget, n+1);
|
||||
wxStringList::Node *node = m_stringList.Item(n);
|
||||
@ -213,7 +213,7 @@ int wxComboBox::GetSelection (void) const
|
||||
return sel - 1;
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetString(int n) const
|
||||
wxString wxComboBox::GetString(unsigned int n) const
|
||||
{
|
||||
wxStringList::Node *node = m_stringList.Item(n);
|
||||
if (node)
|
||||
|
@ -179,7 +179,7 @@ wxString wxComboBox::GetValue() const
|
||||
return str;
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(int n, const wxString& s)
|
||||
void wxComboBox::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
wxXmString text(s);
|
||||
Widget listBox = GetXmList(this);
|
||||
@ -213,12 +213,12 @@ int wxComboBox::DoAppend(const wxString& item)
|
||||
return GetCount() - 1;
|
||||
}
|
||||
|
||||
int wxComboBox::DoInsert(const wxString& item, int pos)
|
||||
int wxComboBox::DoInsert(const wxString& item, unsigned int pos)
|
||||
{
|
||||
wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list"));
|
||||
wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index"));
|
||||
|
||||
if ((size_t)pos == GetCount())
|
||||
if (pos == GetCount())
|
||||
return DoAppend(item);
|
||||
|
||||
wxXmString str( item.c_str() );
|
||||
@ -229,7 +229,7 @@ int wxComboBox::DoInsert(const wxString& item, int pos)
|
||||
return GetCount() - 1;
|
||||
}
|
||||
|
||||
void wxComboBox::Delete(int n)
|
||||
void wxComboBox::Delete(unsigned int n)
|
||||
{
|
||||
#ifdef LESSTIF_VERSION
|
||||
XmListDeletePos (GetXmList(this), n + 1);
|
||||
@ -269,7 +269,7 @@ void wxComboBox::SetSelection (int n)
|
||||
SetValue(GetString(n));
|
||||
#else
|
||||
#if 0
|
||||
wxXmString str( GetString(n).c_str() );
|
||||
wxXmString str(GetString(n).c_str());
|
||||
XmComboBoxSelectItem((Widget) m_mainWidget, str());
|
||||
#endif
|
||||
XtVaSetValues( (Widget)m_mainWidget,
|
||||
@ -285,7 +285,7 @@ int wxComboBox::GetSelection (void) const
|
||||
return wxDoGetSelectionInList( GetXmList( this ) );
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetString(int n) const
|
||||
wxString wxComboBox::GetString(unsigned int n) const
|
||||
{
|
||||
return wxDoGetStringInList( GetXmList(this), n );
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
validator, name ) )
|
||||
return false;
|
||||
|
||||
m_noItems = (size_t)n;
|
||||
m_noItems = (unsigned int)n;
|
||||
m_backgroundColour = * wxWHITE;
|
||||
|
||||
Widget parentWidget = (Widget) parent->GetClientWidget();
|
||||
@ -204,7 +204,7 @@ void wxListBox::DoSetFirstItem( int N )
|
||||
XmListSetPos ((Widget) m_mainWidget, N + 1);
|
||||
}
|
||||
|
||||
void wxListBox::Delete(int N)
|
||||
void wxListBox::Delete(unsigned int n)
|
||||
{
|
||||
wxSizeKeeper sk( this );
|
||||
Widget listBox = (Widget) m_mainWidget;
|
||||
@ -214,13 +214,13 @@ void wxListBox::Delete(int N)
|
||||
if (managed)
|
||||
XtUnmanageChild (listBox);
|
||||
|
||||
XmListDeletePos (listBox, N + 1);
|
||||
XmListDeletePos (listBox, n + 1);
|
||||
|
||||
if (managed)
|
||||
XtManageChild (listBox);
|
||||
|
||||
sk.Restore();
|
||||
m_clientDataDict.Delete(N, HasClientObjectData());
|
||||
m_clientDataDict.Delete(n, HasClientObjectData());
|
||||
m_noItems --;
|
||||
}
|
||||
|
||||
@ -265,7 +265,7 @@ void wxListBox::DoSetItems(const wxArrayString& items, void** clientData)
|
||||
if (managed)
|
||||
XtUnmanageChild (listBox);
|
||||
XmString *text = new XmString[items.GetCount()];
|
||||
size_t i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < items.GetCount(); ++i)
|
||||
text[i] = wxStringToXmString (items[i]);
|
||||
|
||||
@ -390,24 +390,24 @@ bool wxListBox::IsSelected(int N) const
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||
void wxListBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
m_clientDataDict.Set(n, clientData, false);
|
||||
}
|
||||
|
||||
wxClientData* wxListBox::DoGetItemClientObject(int n) const
|
||||
wxClientData* wxListBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return m_clientDataDict.Get(n);
|
||||
}
|
||||
|
||||
void *wxListBox::DoGetItemClientData(int N) const
|
||||
void *wxListBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
return (void*)m_clientDataDict.Get(N);
|
||||
return (void*)m_clientDataDict.Get(n);
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientData(int N, void *Client_data)
|
||||
void wxListBox::DoSetItemClientData(unsigned int n, void *Client_data)
|
||||
{
|
||||
m_clientDataDict.Set(N, (wxClientData*)Client_data, false);
|
||||
m_clientDataDict.Set(n, (wxClientData*)Client_data, false);
|
||||
}
|
||||
|
||||
// Return number of selections and an array of selected integers
|
||||
@ -477,12 +477,12 @@ wxString wxDoGetStringInList( Widget listBox, int n )
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
wxString wxListBox::GetString( int n ) const
|
||||
wxString wxListBox::GetString(unsigned int n) const
|
||||
{
|
||||
return wxDoGetStringInList( (Widget)m_mainWidget, n );
|
||||
}
|
||||
|
||||
void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
void wxListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
|
||||
{
|
||||
wxSizeKeeper sk( this );
|
||||
Widget listBox = (Widget) m_mainWidget;
|
||||
@ -493,7 +493,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
XtUnmanageChild(listBox);
|
||||
|
||||
XmString *text = new XmString[items.GetCount()];
|
||||
size_t i;
|
||||
unsigned int i;
|
||||
// Steve Hammes: Motif 1.1 compatibility
|
||||
// #if XmVersion > 1100
|
||||
// Corrected by Sergey Krasnov from Steve Hammes' code
|
||||
@ -525,7 +525,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
m_noItems += items.GetCount();
|
||||
}
|
||||
|
||||
void wxListBox::SetString(int N, const wxString& s)
|
||||
void wxListBox::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
wxSizeKeeper sk( this );
|
||||
Widget listBox = (Widget) m_mainWidget;
|
||||
@ -534,8 +534,8 @@ void wxListBox::SetString(int N, const wxString& s)
|
||||
|
||||
// delete the item and add it again.
|
||||
// FIXME isn't there a way to change it in place?
|
||||
XmListDeletePos (listBox, N+1);
|
||||
XmListAddItem (listBox, text(), N+1);
|
||||
XmListDeletePos (listBox, n+1);
|
||||
XmListAddItem (listBox, text(), n+1);
|
||||
|
||||
sk.Restore();
|
||||
}
|
||||
@ -666,7 +666,7 @@ void wxListBox::ChangeForegroundColour()
|
||||
*/
|
||||
}
|
||||
|
||||
size_t wxListBox::GetCount() const
|
||||
unsigned int wxListBox::GetCount() const
|
||||
{
|
||||
return m_noItems;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
if( !CreateControl( parent, id, pos, size, style, val, name ) )
|
||||
return false;
|
||||
|
||||
m_noItems = (size_t)n;
|
||||
m_noItems = (unsigned int)n;
|
||||
m_noRowsOrCols = majorDim;
|
||||
|
||||
SetMajorDim(majorDim == 0 ? n : majorDim, style);
|
||||
@ -168,12 +168,12 @@ wxRadioBox::~wxRadioBox()
|
||||
m_mainWidget = (WXWidget) 0;
|
||||
}
|
||||
|
||||
void wxRadioBox::SetString(int item, const wxString& label)
|
||||
void wxRadioBox::SetString(unsigned int item, const wxString& label)
|
||||
{
|
||||
if (!IsValid(item))
|
||||
return;
|
||||
|
||||
Widget widget = (Widget) m_radioButtons[item];
|
||||
Widget widget = (Widget)m_radioButtons[item];
|
||||
if (!label.empty())
|
||||
{
|
||||
wxString label1(wxStripMenuCodes(label));
|
||||
@ -197,8 +197,8 @@ void wxRadioBox::SetSelection(int n)
|
||||
|
||||
XmToggleButtonSetState ((Widget) m_radioButtons[n], True, False);
|
||||
|
||||
for (size_t i = 0; i < m_noItems; i++)
|
||||
if (i != (size_t)n)
|
||||
for (unsigned int i = 0; i < m_noItems; i++)
|
||||
if (i != (unsigned int)n)
|
||||
XmToggleButtonSetState ((Widget) m_radioButtons[i], False, False);
|
||||
|
||||
m_inSetValue = false;
|
||||
@ -211,7 +211,7 @@ int wxRadioBox::GetSelection() const
|
||||
}
|
||||
|
||||
// Find string for position
|
||||
wxString wxRadioBox::GetString(int n) const
|
||||
wxString wxRadioBox::GetString(unsigned int n) const
|
||||
{
|
||||
if (!IsValid(n))
|
||||
return wxEmptyString;
|
||||
@ -243,7 +243,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
}
|
||||
|
||||
// Enable a specific button
|
||||
bool wxRadioBox::Enable(int n, bool enable)
|
||||
bool wxRadioBox::Enable(unsigned int n, bool enable)
|
||||
{
|
||||
if (!IsValid(n))
|
||||
return false;
|
||||
@ -258,7 +258,7 @@ bool wxRadioBox::Enable(bool enable)
|
||||
if ( !wxControl::Enable(enable) )
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < m_noItems; i++)
|
||||
for (unsigned int i = 0; i < m_noItems; i++)
|
||||
XtSetSensitive ((Widget) m_radioButtons[i], (Boolean) enable);
|
||||
|
||||
return true;
|
||||
@ -271,7 +271,7 @@ bool wxRadioBox::Show(bool show)
|
||||
}
|
||||
|
||||
// Show a specific button
|
||||
bool wxRadioBox::Show(int n, bool show)
|
||||
bool wxRadioBox::Show(unsigned int n, bool show)
|
||||
{
|
||||
// This method isn't complete, and we try do do our best...
|
||||
// It's main purpose isn't for allowing Show/Unshow dynamically,
|
||||
@ -305,8 +305,8 @@ bool wxRadioBox::Show(int n, bool show)
|
||||
wxString wxRadioBox::GetStringSelection () const
|
||||
{
|
||||
int sel = GetSelection ();
|
||||
if (sel > -1)
|
||||
return this->GetString (sel);
|
||||
if (sel != wxNOT_FOUND)
|
||||
return this->GetString((unsigned int)sel);
|
||||
else
|
||||
return wxEmptyString;
|
||||
}
|
||||
@ -333,7 +333,7 @@ void wxRadioBox::ChangeFont(bool keepOriginalSize)
|
||||
{
|
||||
wxWindow::ChangeFont(keepOriginalSize);
|
||||
|
||||
for (size_t i = 0; i < m_noItems; i++)
|
||||
for (unsigned int i = 0; i < m_noItems; i++)
|
||||
{
|
||||
WXWidget radioButton = m_radioButtons[i];
|
||||
|
||||
@ -349,7 +349,7 @@ void wxRadioBox::ChangeBackgroundColour()
|
||||
|
||||
int selectPixel = wxBLACK->AllocColour(XtDisplay((Widget)m_mainWidget));
|
||||
|
||||
for (size_t i = 0; i < m_noItems; i++)
|
||||
for (unsigned int i = 0; i < m_noItems; i++)
|
||||
{
|
||||
WXWidget radioButton = m_radioButtons[i];
|
||||
|
||||
@ -365,7 +365,7 @@ void wxRadioBox::ChangeForegroundColour()
|
||||
{
|
||||
wxWindow::ChangeForegroundColour();
|
||||
|
||||
for (size_t i = 0; i < m_noItems; i++)
|
||||
for (unsigned int i = 0; i < m_noItems; i++)
|
||||
{
|
||||
WXWidget radioButton = m_radioButtons[i];
|
||||
|
||||
@ -381,7 +381,7 @@ void wxRadioBoxCallback (Widget w, XtPointer clientData,
|
||||
|
||||
wxRadioBox *item = (wxRadioBox *) clientData;
|
||||
int sel = -1;
|
||||
size_t i;
|
||||
unsigned int i;
|
||||
const wxWidgetArray& buttons = item->GetRadioButtons();
|
||||
for (i = 0; i < item->GetCount(); i++)
|
||||
if (((Widget)buttons[i]) == w)
|
||||
|
@ -126,44 +126,44 @@ class wxCheckListBoxItem : public wxOwnerDrawn
|
||||
{
|
||||
friend class WXDLLEXPORT wxCheckListBox;
|
||||
public:
|
||||
// ctor
|
||||
wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex);
|
||||
// ctor
|
||||
wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex);
|
||||
|
||||
// drawing functions
|
||||
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
|
||||
// drawing functions
|
||||
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
|
||||
|
||||
// simple accessors and operations
|
||||
bool IsChecked() const { return m_bChecked; }
|
||||
// simple accessors and operations
|
||||
bool IsChecked() const { return m_bChecked; }
|
||||
|
||||
void Check(bool bCheck);
|
||||
void Toggle() { Check(!IsChecked()); }
|
||||
void Check(bool bCheck);
|
||||
void Toggle() { Check(!IsChecked()); }
|
||||
|
||||
void SendEvent();
|
||||
void SendEvent();
|
||||
|
||||
private:
|
||||
bool m_bChecked;
|
||||
wxCheckListBox *m_pParent;
|
||||
size_t m_nIndex;
|
||||
bool m_bChecked;
|
||||
wxCheckListBox *m_pParent;
|
||||
size_t m_nIndex;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxCheckListBoxItem)
|
||||
DECLARE_NO_COPY_CLASS(wxCheckListBoxItem)
|
||||
};
|
||||
|
||||
wxCheckListBoxItem::wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex)
|
||||
: wxOwnerDrawn(wxEmptyString, true) // checkable
|
||||
{
|
||||
m_bChecked = false;
|
||||
m_pParent = pParent;
|
||||
m_nIndex = nIndex;
|
||||
m_bChecked = false;
|
||||
m_pParent = pParent;
|
||||
m_nIndex = nIndex;
|
||||
|
||||
// we don't initialize m_nCheckHeight/Width vars because it's
|
||||
// done in OnMeasure while they are used only in OnDraw and we
|
||||
// know that there will always be OnMeasure before OnDraw
|
||||
// we don't initialize m_nCheckHeight/Width vars because it's
|
||||
// done in OnMeasure while they are used only in OnDraw and we
|
||||
// know that there will always be OnMeasure before OnDraw
|
||||
|
||||
// fix appearance for check list boxes: they don't look quite the same as
|
||||
// menu icons
|
||||
SetMarginWidth(::GetSystemMetrics(SM_CXMENUCHECK) -
|
||||
2*wxSystemSettings::GetMetric(wxSYS_EDGE_X) + 1);
|
||||
SetBackgroundColour(pParent->GetBackgroundColour());
|
||||
// fix appearance for check list boxes: they don't look quite the same as
|
||||
// menu icons
|
||||
SetMarginWidth(::GetSystemMetrics(SM_CXMENUCHECK) -
|
||||
2*wxSystemSettings::GetMetric(wxSYS_EDGE_X) + 1);
|
||||
SetBackgroundColour(pParent->GetBackgroundColour());
|
||||
}
|
||||
|
||||
bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc,
|
||||
@ -335,22 +335,22 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
// misc overloaded methods
|
||||
// -----------------------
|
||||
|
||||
void wxCheckListBox::Delete(int N)
|
||||
void wxCheckListBox::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( IsValid(N),
|
||||
wxCHECK_RET( IsValid(n),
|
||||
wxT("invalid index in wxListBox::Delete") );
|
||||
|
||||
wxListBox::Delete(N);
|
||||
wxListBox::Delete(n);
|
||||
|
||||
// free memory
|
||||
delete m_aItems[N];
|
||||
delete m_aItems[n];
|
||||
|
||||
m_aItems.RemoveAt(N);
|
||||
m_aItems.RemoveAt(n);
|
||||
}
|
||||
|
||||
bool wxCheckListBox::SetFont( const wxFont &font )
|
||||
{
|
||||
size_t i;
|
||||
unsigned int i;
|
||||
for ( i = 0; i < m_aItems.GetCount(); i++ )
|
||||
m_aItems[i]->SetFont(font);
|
||||
|
||||
@ -391,16 +391,16 @@ bool wxCheckListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item)
|
||||
// check items
|
||||
// -----------
|
||||
|
||||
bool wxCheckListBox::IsChecked(size_t uiIndex) const
|
||||
bool wxCheckListBox::IsChecked(unsigned int uiIndex) const
|
||||
{
|
||||
wxCHECK_MSG( uiIndex < (size_t)GetCount(), false, _T("bad wxCheckListBox index") );
|
||||
wxCHECK_MSG( IsValid(uiIndex), false, _T("bad wxCheckListBox index") );
|
||||
|
||||
return GetItem(uiIndex)->IsChecked();
|
||||
}
|
||||
|
||||
void wxCheckListBox::Check(size_t uiIndex, bool bCheck)
|
||||
void wxCheckListBox::Check(unsigned int uiIndex, bool bCheck)
|
||||
{
|
||||
wxCHECK_RET( uiIndex < (size_t)GetCount(), _T("bad wxCheckListBox index") );
|
||||
wxCHECK_RET( IsValid(uiIndex), _T("bad wxCheckListBox index") );
|
||||
|
||||
GetItem(uiIndex)->Check(bCheck);
|
||||
}
|
||||
@ -494,21 +494,24 @@ void wxCheckListBox::OnKeyDown(wxKeyEvent& event)
|
||||
|
||||
void wxCheckListBox::OnLeftClick(wxMouseEvent& event)
|
||||
{
|
||||
// clicking on the item selects it, clicking on the checkmark toggles
|
||||
if ( event.GetX() <= wxOwnerDrawn::GetDefaultMarginWidth() ) {
|
||||
int nItem = HitTest(event.GetX(), event.GetY());
|
||||
// clicking on the item selects it, clicking on the checkmark toggles
|
||||
if ( event.GetX() <= wxOwnerDrawn::GetDefaultMarginWidth() )
|
||||
{
|
||||
int nItem = HitTest(event.GetX(), event.GetY());
|
||||
|
||||
if ( nItem != wxNOT_FOUND ) {
|
||||
wxCheckListBoxItem *item = GetItem(nItem);
|
||||
item->Toggle();
|
||||
item->SendEvent();
|
||||
if ( nItem != wxNOT_FOUND )
|
||||
{
|
||||
wxCheckListBoxItem *item = GetItem(nItem);
|
||||
item->Toggle();
|
||||
item->SendEvent();
|
||||
}
|
||||
//else: it's not an error, just click outside of client zone
|
||||
}
|
||||
else
|
||||
{
|
||||
// implement default behaviour: clicking on the item selects it
|
||||
event.Skip();
|
||||
}
|
||||
//else: it's not an error, just click outside of client zone
|
||||
}
|
||||
else {
|
||||
// implement default behaviour: clicking on the item selects it
|
||||
event.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
int wxCheckListBox::DoHitTestItem(wxCoord x, wxCoord y) const
|
||||
@ -521,7 +524,7 @@ int wxCheckListBox::DoHitTestItem(wxCoord x, wxCoord y) const
|
||||
MAKELPARAM(x, y)
|
||||
);
|
||||
|
||||
return nItem >= (int)m_noItems ? wxNOT_FOUND : nItem;
|
||||
return nItem >= (int)m_noItems ? wxNOT_FOUND : nItem;
|
||||
}
|
||||
|
||||
|
||||
|
@ -236,7 +236,7 @@ int wxChoice::DoAppend(const wxString& item)
|
||||
return n;
|
||||
}
|
||||
|
||||
int wxChoice::DoInsert(const wxString& item, int pos)
|
||||
int wxChoice::DoInsert(const wxString& item, unsigned int pos)
|
||||
{
|
||||
wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list"));
|
||||
wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index"));
|
||||
@ -256,7 +256,7 @@ int wxChoice::DoInsert(const wxString& item, int pos)
|
||||
return n;
|
||||
}
|
||||
|
||||
void wxChoice::Delete(int n)
|
||||
void wxChoice::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n), wxT("invalid item index in wxChoice::Delete") );
|
||||
|
||||
@ -289,8 +289,8 @@ void wxChoice::Free()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
size_t count = GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
delete GetClientObject(n);
|
||||
}
|
||||
@ -326,9 +326,9 @@ void wxChoice::SetSelection(int n)
|
||||
// string list functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
size_t wxChoice::GetCount() const
|
||||
unsigned int wxChoice::GetCount() const
|
||||
{
|
||||
return (size_t)SendMessage(GetHwnd(), CB_GETCOUNT, 0, 0);
|
||||
return (unsigned int)SendMessage(GetHwnd(), CB_GETCOUNT, 0, 0);
|
||||
}
|
||||
|
||||
int wxChoice::FindString(const wxString& s, bool bCase) const
|
||||
@ -336,11 +336,11 @@ int wxChoice::FindString(const wxString& s, bool bCase) const
|
||||
#if defined(__WATCOMC__) && defined(__WIN386__)
|
||||
// For some reason, Watcom in WIN386 mode crashes in the CB_FINDSTRINGEXACT message.
|
||||
// wxChoice::Do it the long way instead.
|
||||
size_t count = GetCount();
|
||||
for ( size_t i = 0; i < count; i++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int i = 0; i < count; i++ )
|
||||
{
|
||||
// as CB_FINDSTRINGEXACT is case insensitive, be case insensitive too
|
||||
if ( GetString(i).IsSameAs(s, bCase) )
|
||||
if (GetString(i).IsSameAs(s, bCase))
|
||||
return i;
|
||||
}
|
||||
|
||||
@ -350,10 +350,10 @@ int wxChoice::FindString(const wxString& s, bool bCase) const
|
||||
//passed to SendMessage, so we have to do it ourselves in that case
|
||||
if ( s.empty() )
|
||||
{
|
||||
size_t count = GetCount();
|
||||
for ( size_t i = 0; i < count; i++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int i = 0; i < count; i++ )
|
||||
{
|
||||
if ( GetString(i).empty() )
|
||||
if (GetString(i).empty())
|
||||
return i;
|
||||
}
|
||||
|
||||
@ -374,7 +374,7 @@ int wxChoice::FindString(const wxString& s, bool bCase) const
|
||||
#endif // Watcom/!Watcom
|
||||
}
|
||||
|
||||
void wxChoice::SetString(int n, const wxString& s)
|
||||
void wxChoice::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n), wxT("invalid item index in wxChoice::SetString") );
|
||||
|
||||
@ -404,7 +404,7 @@ void wxChoice::SetString(int n, const wxString& s)
|
||||
InvalidateBestSize();
|
||||
}
|
||||
|
||||
wxString wxChoice::GetString(int n) const
|
||||
wxString wxChoice::GetString(unsigned int n) const
|
||||
{
|
||||
int len = (int)::SendMessage(GetHwnd(), CB_GETLBTEXTLEN, n, 0);
|
||||
|
||||
@ -430,7 +430,7 @@ wxString wxChoice::GetString(int n) const
|
||||
// client data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
void wxChoice::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
if ( ::SendMessage(GetHwnd(), CB_SETITEMDATA,
|
||||
n, (LPARAM)clientData) == CB_ERR )
|
||||
@ -439,7 +439,7 @@ void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
}
|
||||
}
|
||||
|
||||
void* wxChoice::DoGetItemClientData( int n ) const
|
||||
void* wxChoice::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
LPARAM rc = SendMessage(GetHwnd(), CB_GETITEMDATA, n, 0);
|
||||
if ( rc == CB_ERR )
|
||||
@ -453,12 +453,12 @@ void* wxChoice::DoGetItemClientData( int n ) const
|
||||
return (void *)rc;
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
void wxChoice::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
DoSetItemClientData(n, clientData);
|
||||
}
|
||||
|
||||
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
wxClientData* wxChoice::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return (wxClientData *)DoGetItemClientData(n);
|
||||
}
|
||||
@ -516,7 +516,7 @@ void wxChoice::DoSetSize(int x, int y,
|
||||
{
|
||||
// don't make the drop down list too tall, arbitrarily limit it to 40
|
||||
// items max and also don't leave it empty
|
||||
size_t nItems = GetCount();
|
||||
unsigned int nItems = GetCount();
|
||||
if ( !nItems )
|
||||
nItems = 9;
|
||||
else if ( nItems > 24 )
|
||||
@ -595,8 +595,8 @@ wxSize wxChoice::DoGetBestSize() const
|
||||
{
|
||||
// find the widest string
|
||||
int wChoice = 0;
|
||||
const size_t nItems = GetCount();
|
||||
for ( size_t i = 0; i < nItems; i++ )
|
||||
const unsigned int nItems = GetCount();
|
||||
for ( unsigned int i = 0; i < nItems; i++ )
|
||||
{
|
||||
int wLine;
|
||||
GetTextExtent(GetString(i), &wLine, NULL);
|
||||
|
@ -256,9 +256,9 @@ void wxListBox::DoSetFirstItem(int N)
|
||||
SendMessage(GetHwnd(), LB_SETTOPINDEX, (WPARAM)N, (LPARAM)0);
|
||||
}
|
||||
|
||||
void wxListBox::Delete(int N)
|
||||
void wxListBox::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( IsValid(N),
|
||||
wxCHECK_RET( IsValid(n),
|
||||
wxT("invalid index in wxListBox::Delete") );
|
||||
|
||||
// for owner drawn objects, the data is used for storing wxOwnerDrawn
|
||||
@ -268,10 +268,10 @@ void wxListBox::Delete(int N)
|
||||
#endif // !wxUSE_OWNER_DRAWN
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
delete GetClientObject(N);
|
||||
delete GetClientObject(n);
|
||||
}
|
||||
|
||||
SendMessage(GetHwnd(), LB_DELETESTRING, N, 0);
|
||||
SendMessage(GetHwnd(), LB_DELETESTRING, n, 0);
|
||||
m_noItems--;
|
||||
|
||||
SetHorizontalExtent(wxEmptyString);
|
||||
@ -312,7 +312,7 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
|
||||
ListBox_ResetContent(GetHwnd());
|
||||
|
||||
m_noItems = choices.GetCount();
|
||||
size_t i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < m_noItems; i++)
|
||||
{
|
||||
ListBox_AddString(GetHwnd(), choices[i]);
|
||||
@ -328,7 +328,7 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
|
||||
WX_CLEAR_ARRAY(m_aItems);
|
||||
|
||||
// then create new ones
|
||||
for ( size_t ui = 0; ui < m_noItems; ui++ ) {
|
||||
for ( unsigned int ui = 0; ui < m_noItems; ui++ ) {
|
||||
wxOwnerDrawn *pNewItem = CreateLboxItem(ui);
|
||||
pNewItem->SetName(choices[ui]);
|
||||
m_aItems.Add(pNewItem);
|
||||
@ -384,7 +384,7 @@ void wxListBox::Free()
|
||||
#endif // wxUSE_OWNER_DRAWN
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
for ( size_t n = 0; n < m_noItems; n++ )
|
||||
for ( unsigned int n = 0; n < m_noItems; n++ )
|
||||
{
|
||||
delete GetClientObject(n);
|
||||
}
|
||||
@ -414,12 +414,12 @@ bool wxListBox::IsSelected(int N) const
|
||||
return SendMessage(GetHwnd(), LB_GETSEL, N, 0) == 0 ? false : true;
|
||||
}
|
||||
|
||||
wxClientData* wxListBox::DoGetItemClientObject(int n) const
|
||||
wxClientData* wxListBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return (wxClientData *)DoGetItemClientData(n);
|
||||
}
|
||||
|
||||
void *wxListBox::DoGetItemClientData(int n) const
|
||||
void *wxListBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid(n), NULL,
|
||||
wxT("invalid index in wxListBox::GetClientData") );
|
||||
@ -427,12 +427,12 @@ void *wxListBox::DoGetItemClientData(int n) const
|
||||
return (void *)SendMessage(GetHwnd(), LB_GETITEMDATA, n, 0);
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||
void wxListBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
DoSetItemClientData(n, clientData);
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientData(int n, void *clientData)
|
||||
void wxListBox::DoSetItemClientData(unsigned int n, void *clientData)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n),
|
||||
wxT("invalid index in wxListBox::SetClientData") );
|
||||
@ -504,28 +504,28 @@ int wxListBox::GetSelection() const
|
||||
}
|
||||
|
||||
// Find string for position
|
||||
wxString wxListBox::GetString(int N) const
|
||||
wxString wxListBox::GetString(unsigned int n) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid(N), wxEmptyString,
|
||||
wxCHECK_MSG( IsValid(n), wxEmptyString,
|
||||
wxT("invalid index in wxListBox::GetString") );
|
||||
|
||||
int len = ListBox_GetTextLen(GetHwnd(), N);
|
||||
int len = ListBox_GetTextLen(GetHwnd(), n);
|
||||
|
||||
// +1 for terminating NUL
|
||||
wxString result;
|
||||
ListBox_GetText(GetHwnd(), N, (wxChar*)wxStringBuffer(result, len + 1));
|
||||
ListBox_GetText(GetHwnd(), n, (wxChar*)wxStringBuffer(result, len + 1));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
wxListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
|
||||
{
|
||||
wxCHECK_RET( IsValidInsert(pos),
|
||||
wxT("invalid index in wxListBox::InsertItems") );
|
||||
|
||||
int nItems = items.GetCount();
|
||||
for ( int i = 0; i < nItems; i++ )
|
||||
unsigned int nItems = items.GetCount();
|
||||
for ( unsigned int i = 0; i < nItems; i++ )
|
||||
{
|
||||
int idx = ListBox_InsertString(GetHwnd(), i + pos, items[i]);
|
||||
|
||||
@ -561,55 +561,55 @@ int wxListBox::DoListHitTest(const wxPoint& point) const
|
||||
return HIWORD(lRes) ? wxNOT_FOUND : lRes;
|
||||
}
|
||||
|
||||
void wxListBox::SetString(int N, const wxString& s)
|
||||
void wxListBox::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
wxCHECK_RET( IsValid(N),
|
||||
wxCHECK_RET( IsValid(n),
|
||||
wxT("invalid index in wxListBox::SetString") );
|
||||
|
||||
// remember the state of the item
|
||||
bool wasSelected = IsSelected(N);
|
||||
bool wasSelected = IsSelected(n);
|
||||
|
||||
void *oldData = NULL;
|
||||
wxClientData *oldObjData = NULL;
|
||||
if ( m_clientDataItemsType == wxClientData_Void )
|
||||
oldData = GetClientData(N);
|
||||
oldData = GetClientData(n);
|
||||
else if ( m_clientDataItemsType == wxClientData_Object )
|
||||
oldObjData = GetClientObject(N);
|
||||
oldObjData = GetClientObject(n);
|
||||
|
||||
// delete and recreate it
|
||||
SendMessage(GetHwnd(), LB_DELETESTRING, N, 0);
|
||||
SendMessage(GetHwnd(), LB_DELETESTRING, n, 0);
|
||||
|
||||
int newN = N;
|
||||
if ( N == (int)(m_noItems - 1) )
|
||||
int newN = n;
|
||||
if ( n == (m_noItems - 1) )
|
||||
newN = -1;
|
||||
|
||||
ListBox_InsertString(GetHwnd(), newN, s);
|
||||
|
||||
// restore the client data
|
||||
if ( oldData )
|
||||
SetClientData(N, oldData);
|
||||
SetClientData(n, oldData);
|
||||
else if ( oldObjData )
|
||||
SetClientObject(N, oldObjData);
|
||||
SetClientObject(n, oldObjData);
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
if ( m_windowStyle & wxLB_OWNERDRAW )
|
||||
{
|
||||
// update item's text
|
||||
m_aItems[N]->SetName(s);
|
||||
m_aItems[n]->SetName(s);
|
||||
|
||||
// reassign the item's data
|
||||
ListBox_SetItemData(GetHwnd(), N, m_aItems[N]);
|
||||
ListBox_SetItemData(GetHwnd(), n, m_aItems[n]);
|
||||
}
|
||||
#endif //USE_OWNER_DRAWN
|
||||
|
||||
// we may have lost the selection
|
||||
if ( wasSelected )
|
||||
Select(N);
|
||||
Select(n);
|
||||
|
||||
InvalidateBestSize();
|
||||
}
|
||||
|
||||
size_t wxListBox::GetCount() const
|
||||
unsigned int wxListBox::GetCount() const
|
||||
{
|
||||
return m_noItems;
|
||||
}
|
||||
@ -658,7 +658,7 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
|
||||
|
||||
GetTextMetrics(dc, &lpTextMetric);
|
||||
|
||||
for (size_t i = 0; i < m_noItems; i++)
|
||||
for (unsigned int i = 0; i < m_noItems; i++)
|
||||
{
|
||||
wxString str = GetString(i);
|
||||
SIZE extentXY;
|
||||
@ -680,7 +680,7 @@ wxSize wxListBox::DoGetBestSize() const
|
||||
// find the widest string
|
||||
int wLine;
|
||||
int wListbox = 0;
|
||||
for ( size_t i = 0; i < m_noItems; i++ )
|
||||
for (unsigned int i = 0; i < m_noItems; i++)
|
||||
{
|
||||
wxString str(GetString(i));
|
||||
GetTextExtent(str, &wLine, NULL);
|
||||
@ -745,7 +745,7 @@ bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
|
||||
else if ( HasClientUntypedData() )
|
||||
event.SetClientData( GetClientData(n) );
|
||||
|
||||
event.SetString( GetString(n) );
|
||||
event.SetString(GetString(n));
|
||||
event.SetExtraLong( HasMultipleSelection() ? IsSelected(n) : true );
|
||||
}
|
||||
|
||||
|
@ -269,8 +269,8 @@ bool wxRadioBox::MSWCommand(WXUINT cmd, WXWORD id)
|
||||
|
||||
int selectedButton = wxNOT_FOUND;
|
||||
|
||||
const size_t count = GetCount();
|
||||
for ( size_t i = 0; i < count; i++ )
|
||||
const unsigned int count = GetCount();
|
||||
for ( unsigned int i = 0; i < count; i++ )
|
||||
{
|
||||
if ( id == wxGetWindowId((*m_radioButtons)[i]) )
|
||||
{
|
||||
@ -314,7 +314,7 @@ void wxRadioBox::SendNotificationEvent()
|
||||
{
|
||||
wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId);
|
||||
event.SetInt( m_selectedButton );
|
||||
event.SetString( GetString(m_selectedButton) );
|
||||
event.SetString(GetString(m_selectedButton));
|
||||
event.SetEventObject( this );
|
||||
ProcessCommand(event);
|
||||
}
|
||||
@ -323,12 +323,12 @@ void wxRadioBox::SendNotificationEvent()
|
||||
// simple accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
size_t wxRadioBox::GetCount() const
|
||||
unsigned int wxRadioBox::GetCount() const
|
||||
{
|
||||
return m_radioButtons->GetCount();
|
||||
}
|
||||
|
||||
void wxRadioBox::SetString(int item, const wxString& label)
|
||||
void wxRadioBox::SetString(unsigned int item, const wxString& label)
|
||||
{
|
||||
wxCHECK_RET( IsValid(item), wxT("invalid radiobox index") );
|
||||
|
||||
@ -355,7 +355,7 @@ void wxRadioBox::SetSelection(int N)
|
||||
}
|
||||
|
||||
// Find string for position
|
||||
wxString wxRadioBox::GetString(int item) const
|
||||
wxString wxRadioBox::GetString(unsigned int item) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid(item), wxEmptyString,
|
||||
wxT("invalid radiobox index") );
|
||||
@ -374,7 +374,7 @@ void wxRadioBox::SetFocus()
|
||||
}
|
||||
|
||||
// Enable a specific button
|
||||
bool wxRadioBox::Enable(int item, bool enable)
|
||||
bool wxRadioBox::Enable(unsigned int item, bool enable)
|
||||
{
|
||||
wxCHECK_MSG( IsValid(item), false,
|
||||
wxT("invalid item in wxRadioBox::Enable()") );
|
||||
@ -384,7 +384,7 @@ bool wxRadioBox::Enable(int item, bool enable)
|
||||
return (ret == 0) != enable;
|
||||
}
|
||||
|
||||
bool wxRadioBox::IsItemEnabled(int item) const
|
||||
bool wxRadioBox::IsItemEnabled(unsigned int item) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid(item), false,
|
||||
wxT("invalid item in wxRadioBox::IsItemEnabled()") );
|
||||
@ -393,7 +393,7 @@ bool wxRadioBox::IsItemEnabled(int item) const
|
||||
}
|
||||
|
||||
// Show a specific button
|
||||
bool wxRadioBox::Show(int item, bool show)
|
||||
bool wxRadioBox::Show(unsigned int item, bool show)
|
||||
{
|
||||
wxCHECK_MSG( IsValid(item), false,
|
||||
wxT("invalid item in wxRadioBox::Show()") );
|
||||
@ -409,7 +409,7 @@ bool wxRadioBox::Show(int item, bool show)
|
||||
return changed;
|
||||
}
|
||||
|
||||
bool wxRadioBox::IsItemShown(int item) const
|
||||
bool wxRadioBox::IsItemShown(unsigned int item) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid(item), false,
|
||||
wxT("invalid item in wxRadioBox::IsItemShown()") );
|
||||
@ -432,8 +432,8 @@ wxSize wxRadioBox::GetMaxButtonSize() const
|
||||
// calculate the max button size
|
||||
int widthMax = 0,
|
||||
heightMax = 0;
|
||||
const size_t count = GetCount();
|
||||
for ( size_t i = 0 ; i < count; i++ )
|
||||
const unsigned int count = GetCount();
|
||||
for ( unsigned int i = 0 ; i < count; i++ )
|
||||
{
|
||||
int width, height;
|
||||
if ( m_radioWidth[i] < 0 )
|
||||
@ -565,8 +565,8 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int startX = x_offset;
|
||||
int startY = y_offset;
|
||||
|
||||
const size_t count = GetCount();
|
||||
for ( size_t i = 0; i < count; i++ )
|
||||
const unsigned int count = GetCount();
|
||||
for (unsigned int i = 0; i < count; i++)
|
||||
{
|
||||
// the last button in the row may be wider than the other ones as the
|
||||
// radiobox may be wider than the sum of the button widths (as it
|
||||
@ -576,7 +576,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
// item is the last in its row if it is a multiple of the number of
|
||||
// columns or if it is just the last item
|
||||
size_t n = i + 1;
|
||||
unsigned int n = i + 1;
|
||||
isLastInTheRow = ((n % GetMajorDim()) == 0) || (n == count);
|
||||
}
|
||||
else // wxRA_SPECIFY_ROWS
|
||||
@ -651,8 +651,8 @@ WXHRGN wxRadioBox::MSWGetRegionWithoutChildren()
|
||||
::GetWindowRect(GetHwnd(), &rc);
|
||||
HRGN hrgn = ::CreateRectRgn(rc.left, rc.top, rc.right + 1, rc.bottom + 1);
|
||||
|
||||
const size_t count = GetCount();
|
||||
for ( size_t i = 0; i < count; ++i )
|
||||
const unsigned int count = GetCount();
|
||||
for ( unsigned int i = 0; i < count; ++i )
|
||||
{
|
||||
// don't clip out hidden children
|
||||
if ( !IsItemShown(i) )
|
||||
|
@ -154,7 +154,7 @@ void wxCheckListBox::OnSize(wxSizeEvent& event)
|
||||
// misc overloaded methods
|
||||
// -----------------------
|
||||
|
||||
void wxCheckListBox::Delete(int n)
|
||||
void wxCheckListBox::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( IsValid( n ), _T("invalid index in wxCheckListBox::Delete") );
|
||||
|
||||
@ -168,7 +168,7 @@ void wxCheckListBox::Delete(int n)
|
||||
// check items
|
||||
// -----------
|
||||
|
||||
bool wxCheckListBox::IsChecked(size_t uiIndex) const
|
||||
bool wxCheckListBox::IsChecked(unsigned int uiIndex) const
|
||||
{
|
||||
wxCHECK_MSG( IsValid( uiIndex ), false,
|
||||
_T("invalid index in wxCheckListBox::IsChecked") );
|
||||
@ -176,7 +176,7 @@ bool wxCheckListBox::IsChecked(size_t uiIndex) const
|
||||
return (ListView_GetCheckState(((HWND)GetHWND()), uiIndex) != 0);
|
||||
}
|
||||
|
||||
void wxCheckListBox::Check(size_t uiIndex, bool bCheck)
|
||||
void wxCheckListBox::Check(unsigned int uiIndex, bool bCheck)
|
||||
{
|
||||
wxCHECK_RET( IsValid( uiIndex ),
|
||||
_T("invalid index in wxCheckListBox::Check") );
|
||||
@ -189,7 +189,7 @@ void wxCheckListBox::Check(size_t uiIndex, bool bCheck)
|
||||
|
||||
void wxCheckListBox::Clear()
|
||||
{
|
||||
int n = (int)GetCount();
|
||||
unsigned int n = GetCount();
|
||||
|
||||
while ( n > 0 )
|
||||
{
|
||||
@ -203,15 +203,15 @@ void wxCheckListBox::Clear()
|
||||
_T("broken wxCheckListBox::Clear()") );
|
||||
}
|
||||
|
||||
size_t wxCheckListBox::GetCount() const
|
||||
unsigned int wxCheckListBox::GetCount() const
|
||||
{
|
||||
return (size_t)ListView_GetItemCount( (HWND)GetHWND() );
|
||||
return (unsigned int)ListView_GetItemCount( (HWND)GetHWND() );
|
||||
}
|
||||
|
||||
int wxCheckListBox::GetSelection() const
|
||||
{
|
||||
int i;
|
||||
for (i = 0; (size_t)i < GetCount(); i++)
|
||||
for (i = 0; (unsigned int)i < GetCount(); i++)
|
||||
{
|
||||
int selState = ListView_GetItemState(GetHwnd(), i, LVIS_SELECTED);
|
||||
if (selState == LVIS_SELECTED)
|
||||
@ -224,7 +224,7 @@ int wxCheckListBox::GetSelection() const
|
||||
int wxCheckListBox::GetSelections(wxArrayInt& aSelections) const
|
||||
{
|
||||
int i;
|
||||
for (i = 0; (size_t)i < GetCount(); i++)
|
||||
for (i = 0; (unsigned int)i < GetCount(); i++)
|
||||
{
|
||||
int selState = ListView_GetItemState(GetHwnd(), i, LVIS_SELECTED);
|
||||
if (selState == LVIS_SELECTED)
|
||||
@ -234,7 +234,7 @@ int wxCheckListBox::GetSelections(wxArrayInt& aSelections) const
|
||||
return aSelections.GetCount();
|
||||
}
|
||||
|
||||
wxString wxCheckListBox::GetString(int n) const
|
||||
wxString wxCheckListBox::GetString(unsigned int n) const
|
||||
{
|
||||
const int bufSize = 513;
|
||||
wxChar buf[bufSize];
|
||||
@ -250,7 +250,7 @@ bool wxCheckListBox::IsSelected(int n) const
|
||||
return (selState == LVIS_SELECTED);
|
||||
}
|
||||
|
||||
void wxCheckListBox::SetString(int n, const wxString& s)
|
||||
void wxCheckListBox::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
wxCHECK_RET( IsValid( n ),
|
||||
_T("invalid index in wxCheckListBox::SetString") );
|
||||
@ -273,22 +273,22 @@ int wxCheckListBox::DoAppend(const wxString& item)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void* wxCheckListBox::DoGetItemClientData(int n) const
|
||||
void* wxCheckListBox::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
return m_itemsClientData.Item(n);
|
||||
}
|
||||
|
||||
wxClientData* wxCheckListBox::DoGetItemClientObject(int n) const
|
||||
wxClientData* wxCheckListBox::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return (wxClientData *)DoGetItemClientData(n);
|
||||
}
|
||||
|
||||
void wxCheckListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
void wxCheckListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
|
||||
{
|
||||
wxCHECK_RET( IsValidInsert( pos ),
|
||||
wxT("invalid index in wxListBox::InsertItems") );
|
||||
|
||||
for( size_t i = 0; i < items.GetCount(); i++ )
|
||||
for( unsigned int i = 0; i < items.GetCount(); i++ )
|
||||
{
|
||||
LVITEM newItem;
|
||||
wxZeroMemory(newItem);
|
||||
@ -311,12 +311,12 @@ void wxCheckListBox::DoSetFirstItem(int n)
|
||||
ListView_Scroll( (HWND)GetHWND(), 0, ppt.y );
|
||||
}
|
||||
|
||||
void wxCheckListBox::DoSetItemClientData(int n, void* clientData)
|
||||
void wxCheckListBox::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
m_itemsClientData.Item(n) = clientData;
|
||||
}
|
||||
|
||||
void wxCheckListBox::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||
void wxCheckListBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
DoSetItemClientData(n, clientData);
|
||||
}
|
||||
@ -325,7 +325,7 @@ void wxCheckListBox::DoSetItems(const wxArrayString& items, void **clientData)
|
||||
{
|
||||
ListView_SetItemCount( GetHwnd(), GetCount() + items.GetCount() );
|
||||
|
||||
for( size_t i = 0; i < items.GetCount(); i++ )
|
||||
for( unsigned int i = 0; i < items.GetCount(); i++ )
|
||||
{
|
||||
int pos = Append(items[i]);
|
||||
if( pos >= 0 && clientData )
|
||||
|
@ -345,7 +345,7 @@ int wxChoice::DoAppend(const wxString& item)
|
||||
return n;
|
||||
}
|
||||
|
||||
int wxChoice::DoInsert(const wxString& item, int pos)
|
||||
int wxChoice::DoInsert(const wxString& item, unsigned int pos)
|
||||
{
|
||||
wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into choice"));
|
||||
wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index"));
|
||||
@ -359,7 +359,7 @@ int wxChoice::DoInsert(const wxString& item, int pos)
|
||||
return n;
|
||||
}
|
||||
|
||||
void wxChoice::Delete(int n)
|
||||
void wxChoice::Delete(unsigned int n)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n), wxT("invalid item index in wxChoice::Delete") );
|
||||
|
||||
@ -382,8 +382,8 @@ void wxChoice::Free()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
{
|
||||
size_t count = GetCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
unsigned int count = GetCount();
|
||||
for ( unsigned int n = 0; n < count; n++ )
|
||||
{
|
||||
delete GetClientObject(n);
|
||||
}
|
||||
@ -408,9 +408,9 @@ void wxChoice::SetSelection(int n)
|
||||
// string list functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
size_t wxChoice::GetCount() const
|
||||
unsigned int wxChoice::GetCount() const
|
||||
{
|
||||
return (size_t)::SendMessage(GetBuddyHwnd(), LB_GETCOUNT, 0, 0);
|
||||
return (unsigned int)::SendMessage(GetBuddyHwnd(), LB_GETCOUNT, 0, 0);
|
||||
}
|
||||
|
||||
int wxChoice::FindString(const wxString& s, bool bCase) const
|
||||
@ -425,7 +425,7 @@ int wxChoice::FindString(const wxString& s, bool bCase) const
|
||||
return pos == LB_ERR ? wxNOT_FOUND : pos;
|
||||
}
|
||||
|
||||
void wxChoice::SetString(int n, const wxString& s)
|
||||
void wxChoice::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
wxCHECK_RET( IsValid(n),
|
||||
wxT("invalid item index in wxChoice::SetString") );
|
||||
@ -454,7 +454,7 @@ void wxChoice::SetString(int n, const wxString& s)
|
||||
//else: it's already NULL by default
|
||||
}
|
||||
|
||||
wxString wxChoice::GetString(int n) const
|
||||
wxString wxChoice::GetString(unsigned int n) const
|
||||
{
|
||||
int len = (int)::SendMessage(GetBuddyHwnd(), LB_GETTEXTLEN, n, 0);
|
||||
|
||||
@ -480,7 +480,7 @@ wxString wxChoice::GetString(int n) const
|
||||
// client data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
void wxChoice::DoSetItemClientData(unsigned int n, void* clientData)
|
||||
{
|
||||
if ( ::SendMessage(GetHwnd(), LB_SETITEMDATA,
|
||||
n, (LPARAM)clientData) == LB_ERR )
|
||||
@ -489,7 +489,7 @@ void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
}
|
||||
}
|
||||
|
||||
void* wxChoice::DoGetItemClientData( int n ) const
|
||||
void* wxChoice::DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
LPARAM rc = ::SendMessage(GetHwnd(), LB_GETITEMDATA, n, 0);
|
||||
if ( rc == LB_ERR )
|
||||
@ -503,12 +503,12 @@ void* wxChoice::DoGetItemClientData( int n ) const
|
||||
return (void *)rc;
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
void wxChoice::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
|
||||
{
|
||||
DoSetItemClientData(n, clientData);
|
||||
}
|
||||
|
||||
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
wxClientData* wxChoice::DoGetItemClientObject(unsigned int n) const
|
||||
{
|
||||
return (wxClientData *)DoGetItemClientData(n);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user