const wxSize &size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
- const wxString &name = _T("listctrl"))
+ const wxString &name = wxListCtrlNameStr)
: wxListCtrl(parent, id, pos, size, style, validator, name)
{
CreateColumns();
void wxEditableListBox::OnEndLabelEdit(wxListEvent& event)
{
if ( event.GetIndex() == m_listCtrl->GetItemCount()-1 &&
- !event.GetText().IsEmpty() )
+ !event.GetText().empty() )
{
// The user edited last (empty) line, i.e. added new entry. We have to
// add new empty line here so that adding one more line is still
control is a virtual control in which the items data (including text, images
and attributes) is managed by the main program and is requested by the control
itself only when needed which allows to have controls with millions of items
-without consuming much memory. To use virtual list control you must use
-\helpref{SetItemCount}{wxlistctrlsetitemcount} first and overload at least
-\helpref{OnGetItemText}{wxlistctrlongetitemtext} (and optionally
-\helpref{OnGetItemImage}{wxlistctrlongetitemimage} and
+without consuming much memory. To use virtual list control you must use
+\helpref{SetItemCount}{wxlistctrlsetitemcount} first and overload at least
+\helpref{OnGetItemText}{wxlistctrlongetitemtext} (and optionally
+\helpref{OnGetItemImage}{wxlistctrlongetitemimage} and
\helpref{OnGetItemAttr}{wxlistctrlongetitemattr}) to return the information
about the items when the control requests it. Virtual list control can be used
as a normal one except that no operations which can take time proportional to
\func{}{wxListCtrl}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id},\rtfsp
\param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp
-\param{long}{ style = wxLC\_ICON}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``listCtrl"}}
+\param{long}{ style = wxLC\_ICON}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxListCtrlNameStr}}
Constructor, creating and showing a list control.
\func{void}{AssignImageList}{\param{wxImageList*}{ imageList}, \param{int }{which}}
-Sets the image list associated with the control and
+Sets the image list associated with the control and
takes ownership of it (i.e. the control will, unlike when using
SetImageList, delete the list when destroyed). {\it which} is one of
wxIMAGE\_LIST\_NORMAL, wxIMAGE\_LIST\_SMALL, wxIMAGE\_LIST\_STATE (the last is unimplemented).
\func{bool}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id},\rtfsp
\param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp
-\param{long}{ style = wxLC\_ICON}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``listCtrl"}}
+\param{long}{ style = wxLC\_ICON}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxListCtrlNameStr}}
Creates the list control. See \helpref{wxListCtrl::wxListCtrl}{wxlistctrlctor} for further details.
\func{long}{FindItem}{\param{long }{start}, \param{const wxPoint\& }{pt}, \param{int }{direction}}
-Find an item nearest this position in the specified direction, starting from
+Find an item nearest this position in the specified direction, starting from
{\it start} or the beginning if {\it start} is -1.
\pythonnote{In place of a single overloaded method name, wxPython
\func{virtual wxListItemAttr *}{OnGetItemAttr}{\param{long }{item}}
-This function may be overloaded in the derived class for a control with
+This function may be overloaded in the derived class for a control with
{\tt wxLC\_VIRTUAL} style. It should return the attribute for the
for the specified {\tt item} or {\tt NULL} to use the default appearance
parameters.
\func{virtual int}{OnGetItemImage}{\param{long }{item}}
-This function must be overloaded in the derived class for a control with
-{\tt wxLC\_VIRTUAL} style having an \helpref{image list}{wxlistctrlsetimagelist}
+This function must be overloaded in the derived class for a control with
+{\tt wxLC\_VIRTUAL} style having an \helpref{image list}{wxlistctrlsetimagelist}
(if the control doesn't have an image list, it is not necessary to overload
it). It should return the index of the items image in the controls image list
or $-1$ for no image.
\constfunc{virtual wxString}{OnGetItemText}{\param{long }{item}, \param{long }{column}}
-This function {\bf must} be overloaded in the derived class for a control with
+This function {\bf must} be overloaded in the derived class for a control with
{\tt wxLC\_VIRTUAL} style. It should return the string containing the text of
the given {\it column} for the specified {\tt item}.
\func{bool}{ScrollList}{\param{int }{dx}, \param{int }{dy}}
-Scrolls the list control. If in icon, small icon or report view mode,
-{\it dx} specifies the number of pixels to scroll. If in list view mode,
+Scrolls the list control. If in icon, small icon or report view mode,
+{\it dx} specifies the number of pixels to scroll. If in list view mode,
{\it dx} specifies the number of columns to scroll. {\it dy} always specifies
the number of pixels to scroll vertically.
Sets the background colour for this item. This function only works in report view.
-The colour can be retrieved using
+The colour can be retrieved using
\helpref{GetItemBackgroundColour}{wxlistctrlgetitembackgroundcolour}.
Sets the colour for this item. This function only works in report view.
-The colour can be retrieved using
+The colour can be retrieved using
\helpref{GetItemTextColour}{wxlistctrlgetitemtextcolour}.
// Purpose: Generic list control
// Author: Robert Roebling
// Created: 01/02/97
-// Id:
+// RCS-ID: $Id$
// Copyright: (c) 1998 Robert Roebling and Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
const wxSize &size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
- const wxString &name = wxT("listctrl") )
+ const wxString &name = wxListCtrlNameStr)
{
Create(parent, winid, pos, size, style, validator, name);
}
const wxSize &size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
- const wxString &name = wxT("listctrl") );
+ const wxString &name = wxListCtrlNameStr);
bool GetColumn( int col, wxListItem& item ) const;
bool SetColumn( int col, wxListItem& item );
virtual void SetFocus();
virtual wxSize DoGetBestSize() const;
-
+
// implementation
// --------------
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator &validator = wxDefaultValidator,
- const wxString &name = wxT("listctrl") )
+ const wxString &name = wxListCtrlNameStr)
: wxGenericListCtrl(parent, winid, pos, size, style, validator, name)
{
}
#include "wx/listbase.h"
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+WXDLLEXPORT_DATA(extern const wxChar*) wxListCtrlNameStr;
+
// ----------------------------------------------------------------------------
// include the wxListCtrl class declaration
// ----------------------------------------------------------------------------
const wxSize& size = wxDefaultSize,
long style = wxLC_REPORT,
const wxValidator& validator = wxDefaultValidator,
- const wxString &name = wxT("listctrl") )
+ const wxString &name = wxListCtrlNameStr)
{
Create(parent, winid, pos, size, style, validator, name);
}
inline wxListCtrl(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
- const wxString& name = "listCtrl")
+ const wxString& name = wxListCtrlNameStr)
{
Create(parent, id, pos, size, style, validator, name);
}
~wxListCtrl();
bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxListCtrl");
+ long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListCtrlNameStr);
// Attributes
int GetColumnCount() const;
// Retrieves the spacing between icons in pixels.
- // If small is TRUE, gets the spacing for the small icon
+ // If isSmall is true, gets the spacing for the small icon
// view, otherwise the large icon view.
int GetItemSpacing(bool isSmall) const;
long GetTopItem() const ;
// Add or remove a single window style
- void SetSingleStyle(long style, bool add = TRUE) ;
+ void SetSingleStyle(long style, bool add = true) ;
// Set the whole window style
void SetWindowStyleFlag(long style) ;
// Find an item whose label matches this string, starting from the item after 'start'
// or the beginning if 'start' is -1.
- long FindItem(long start, const wxString& str, bool partial = FALSE);
+ long FindItem(long start, const wxString& str, bool partial = false);
// Find an item whose data matches this data, starting from the item after 'start'
// or the beginning if 'start' is -1.
inline wxListCtrl(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
- const wxString& name = "listCtrl")
+ const wxString& name = wxListCtrlNameStr)
{
Create(parent, id, pos, size, style, validator, name);
}
~wxListCtrl();
bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxListCtrl");
+ long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListCtrlNameStr);
// Attributes
int GetColumnCount() const;
// Retrieves the spacing between icons in pixels.
- // If small is TRUE, gets the spacing for the small icon
+ // If isSmall is true, gets the spacing for the small icon
// view, otherwise the large icon view.
int GetItemSpacing(bool isSmall) const;
long GetTopItem() const ;
// Add or remove a single window style
- void SetSingleStyle(long style, bool add = TRUE) ;
+ void SetSingleStyle(long style, bool add = true) ;
// Set the whole window style
void SetWindowStyleFlag(long style) ;
// Find an item whose label matches this string, starting from the item after 'start'
// or the beginning if 'start' is -1.
- long FindItem(long start, const wxString& str, bool partial = FALSE);
+ long FindItem(long start, const wxString& str, bool partial = false);
// Find an item whose data matches this data, starting from the item after 'start'
// or the beginning if 'start' is -1.
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
- const wxString& name = _T("wxListCtrl"))
+ const wxString& name = wxListCtrlNameStr)
{
Init();
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
- const wxString& name = _T("wxListCtrl"));
+ const wxString& name = wxListCtrlNameStr);
// Attributes
+///////////////////////////////////////////////////////////////////////////////
+// Name: wx/os2/listctrl.h
+// Purpose: wxListCtrl class
+// Author:
+// Modified by:
+// Created:
+// RCS-ID: $Id$
+// Copyright: (c) wxWidgets team
+// Licence: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
#ifndef _WX_LISTCTRL_H_
#define _WX_LISTCTRL_H_
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxLC_ICON
,const wxValidator& rValidator = wxDefaultValidator
- ,const wxString& rsName = _T("wxListCtrl"))
+ ,const wxString& rsName = wxListCtrlNameStr)
{
Init();
Create( pParent
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxLC_ICON
,const wxValidator& rValidator = wxDefaultValidator
- ,const wxString& rsName = _T("wxListCtrl")
+ ,const wxString& rsName = wxListCtrlNameStr
);
//
// Retrieves the spacing between icons in pixels.
- // If small is TRUE, gets the spacing for the small icon
+ // If bIsSmall is true, gets the spacing for the small icon
// view, otherwise the large icon view.
//
int GetItemSpacing(bool bIsSmall) const;
//
// Add or remove a single window style
void SetSingleStyle( long lStyle
- ,bool bAdd = TRUE
+ ,bool bAdd = true
);
//
//
long FindItem( long lStart
,const wxString& rsStr
- ,bool bPartial = FALSE
+ ,bool bPartial = false
);
//
// keep track of inserted/deleted columns
//
- // TRUE if we have any internal data (user data & attributes)
+ // true if we have any internal data (user data & attributes)
//
bool m_bAnyInternalData;
//
- // TRUE if we have any items with custom attributes
+ // true if we have any items with custom attributes
//
bool m_bHasAnyAttr;
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id$
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
- addition of further convenience functions
to avoid use of wxListItem in some functions
- state/overlay images: probably not needed.
- - in Win95, you can be called back to supply other information
- besides text, such as state information. This saves no memory
- and is probably superfluous to requirements.
- testing of whole API, extending current sample.
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
- const wxString& name = _T("wxListCtrl"))
+ const wxString& name = wxListCtrlNameStr)
{
Init();
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
- const wxString& name = _T("wxListCtrl"));
+ const wxString& name = wxListCtrlNameStr);
// Attributes
wxImageList *GetImageList(int which) const ;
// Sets the image list
- // N.B. There's a quirk in the Win95 list view implementation.
- // If in wxLC_LIST mode, it'll *still* display images by the labels if
- // there's a small-icon image list set for the control - even though you
- // haven't specified wxLIST_MASK_IMAGE when inserting.
- // So you have to set a NULL small-icon image list to be sure that
- // the wxLC_LIST mode works without icons. Of course, you may want icons...
void SetImageList(wxImageList *imageList, int which) ;
void AssignImageList(wxImageList *imageList, int which) ;
virtual wxListItemAttr *OnGetItemAttr(long item) const;
private:
- // process NM_CUSTOMDRAW notification message
- WXLPARAM OnCustomDraw(WXLPARAM lParam);
DECLARE_DYNAMIC_CLASS(wxListCtrl)
DECLARE_EVENT_TABLE()
#endif // wxUSE_LISTCTRL
#endif // _WX_LISTCTRL_H_
-
WXDLLEXPORT_DATA(const wxChar *) wxGaugeNameStr = wxT("gauge");
WXDLLEXPORT_DATA(const wxChar *) wxStaticBoxNameStr = wxT("groupBox");
WXDLLEXPORT_DATA(const wxChar *) wxListBoxNameStr = wxT("listBox");
+WXDLLEXPORT_DATA(const wxChar *) wxListCtrlNameStr = wxT("listctrl");
WXDLLEXPORT_DATA(const wxChar *) wxStaticTextNameStr = wxT("message");
WXDLLEXPORT_DATA(const wxChar *) wxStaticBitmapNameStr = wxT("message");
WXDLLEXPORT_DATA(const wxChar *) wxMultiTextNameStr = wxT("multitext");
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id$
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#pragma hdrstop
#endif
-#if wxUSE_LISTCTRL && defined(__WIN95__)
+#if wxUSE_LISTCTRL
#ifndef WX_PRECOMP
#include "wx/app.h"
#include "wx/listctrl.h"
#include "wx/dcclient.h"
-#include "wx/palmos/private.h"
-
-#include "wx/palmos/wrapcctl.h"
-
-// ----------------------------------------------------------------------------
-// private functions
-// ----------------------------------------------------------------------------
-
-// ----------------------------------------------------------------------------
-// private helper classes
-// ----------------------------------------------------------------------------
-
// ----------------------------------------------------------------------------
// events
// ----------------------------------------------------------------------------
// accessors
// ----------------------------------------------------------------------------
-/* static */ wxVisualAttributes
-wxListCtrl::GetClassDefaultAttributes(wxWindowVariant variant)
+/* static */ wxVisualAttributes wxListCtrl::GetClassDefaultAttributes(wxWindowVariant variant)
{
wxVisualAttributes attrs;
// message processing
// ----------------------------------------------------------------------------
-// see comment at the end of wxListCtrl::GetColumn()
-#ifdef NM_CUSTOMDRAW // _WIN32_IE >= 0x0300
-
-WXLPARAM wxListCtrl::OnCustomDraw(WXLPARAM lParam)
-{
- return CDRF_DODEFAULT;
-}
-
-#endif // NM_CUSTOMDRAW supported
-
// Necessary for drawing hrules and vrules, if specified
void wxListCtrl::OnPaint(wxPaintEvent& event)
{
return NULL;
};
-static
-wxListItemInternalData *wxGetInternalData(const wxListCtrl *ctl, long itemId)
+static wxListItemInternalData *wxGetInternalData(const wxListCtrl *ctl, long itemId)
{
return wxGetInternalData(GetHwndOf(ctl), itemId);
};