]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/common/listctrlcmn.cpp
Move the wxWebFileProtocolHandler from the IE backend to the common source, add the...
[wxWidgets.git] / src / common / listctrlcmn.cpp
... / ...
CommitLineData
1////////////////////////////////////////////////////////////////////////////////
2// Name: src/common/listctrlcmn.cpp
3// Purpose: Common defines for wxListCtrl and wxListCtrl-based classes.
4// Author: Kevin Ollivier
5// Created: 09/15/06
6// RCS-ID: $Id$
7// Copyright: (c) Kevin Ollivier
8// Licence: wxWindows licence
9////////////////////////////////////////////////////////////////////////////////
10
11// =============================================================================
12// declarations
13// =============================================================================
14
15// -----------------------------------------------------------------------------
16// headers
17// -----------------------------------------------------------------------------
18
19// For compilers that support precompilation, includes "wx.h".
20#include "wx/wxprec.h"
21
22#ifdef __BORLANDC__
23 #pragma hdrstop
24#endif
25
26#if wxUSE_LISTCTRL
27
28#include "wx/listctrl.h"
29
30const char wxListCtrlNameStr[] = "listCtrl";
31
32// ListCtrl events
33wxDEFINE_EVENT( wxEVT_COMMAND_LIST_BEGIN_DRAG, wxListEvent );
34wxDEFINE_EVENT( wxEVT_COMMAND_LIST_BEGIN_RDRAG, wxListEvent );
35wxDEFINE_EVENT( wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, wxListEvent );
36wxDEFINE_EVENT( wxEVT_COMMAND_LIST_END_LABEL_EDIT, wxListEvent );
37wxDEFINE_EVENT( wxEVT_COMMAND_LIST_DELETE_ITEM, wxListEvent );
38wxDEFINE_EVENT( wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, wxListEvent );
39wxDEFINE_EVENT( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEvent );
40wxDEFINE_EVENT( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEvent );
41wxDEFINE_EVENT( wxEVT_COMMAND_LIST_KEY_DOWN, wxListEvent );
42wxDEFINE_EVENT( wxEVT_COMMAND_LIST_INSERT_ITEM, wxListEvent );
43wxDEFINE_EVENT( wxEVT_COMMAND_LIST_COL_CLICK, wxListEvent );
44wxDEFINE_EVENT( wxEVT_COMMAND_LIST_COL_RIGHT_CLICK, wxListEvent );
45wxDEFINE_EVENT( wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, wxListEvent );
46wxDEFINE_EVENT( wxEVT_COMMAND_LIST_COL_DRAGGING, wxListEvent );
47wxDEFINE_EVENT( wxEVT_COMMAND_LIST_COL_END_DRAG, wxListEvent );
48wxDEFINE_EVENT( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEvent );
49wxDEFINE_EVENT( wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, wxListEvent );
50wxDEFINE_EVENT( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEvent );
51wxDEFINE_EVENT( wxEVT_COMMAND_LIST_ITEM_FOCUSED, wxListEvent );
52wxDEFINE_EVENT( wxEVT_COMMAND_LIST_CACHE_HINT, wxListEvent );
53
54// -----------------------------------------------------------------------------
55// XTI
56// -----------------------------------------------------------------------------
57
58wxDEFINE_FLAGS( wxListCtrlStyle )
59wxBEGIN_FLAGS( wxListCtrlStyle )
60// new style border flags, we put them first to
61// use them for streaming out
62wxFLAGS_MEMBER(wxBORDER_SIMPLE)
63wxFLAGS_MEMBER(wxBORDER_SUNKEN)
64wxFLAGS_MEMBER(wxBORDER_DOUBLE)
65wxFLAGS_MEMBER(wxBORDER_RAISED)
66wxFLAGS_MEMBER(wxBORDER_STATIC)
67wxFLAGS_MEMBER(wxBORDER_NONE)
68
69// old style border flags
70wxFLAGS_MEMBER(wxSIMPLE_BORDER)
71wxFLAGS_MEMBER(wxSUNKEN_BORDER)
72wxFLAGS_MEMBER(wxDOUBLE_BORDER)
73wxFLAGS_MEMBER(wxRAISED_BORDER)
74wxFLAGS_MEMBER(wxSTATIC_BORDER)
75wxFLAGS_MEMBER(wxBORDER)
76
77// standard window styles
78wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
79wxFLAGS_MEMBER(wxCLIP_CHILDREN)
80wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
81wxFLAGS_MEMBER(wxWANTS_CHARS)
82wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
83wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
84wxFLAGS_MEMBER(wxVSCROLL)
85wxFLAGS_MEMBER(wxHSCROLL)
86
87wxFLAGS_MEMBER(wxLC_LIST)
88wxFLAGS_MEMBER(wxLC_REPORT)
89wxFLAGS_MEMBER(wxLC_ICON)
90wxFLAGS_MEMBER(wxLC_SMALL_ICON)
91wxFLAGS_MEMBER(wxLC_ALIGN_TOP)
92wxFLAGS_MEMBER(wxLC_ALIGN_LEFT)
93wxFLAGS_MEMBER(wxLC_AUTOARRANGE)
94wxFLAGS_MEMBER(wxLC_USER_TEXT)
95wxFLAGS_MEMBER(wxLC_EDIT_LABELS)
96wxFLAGS_MEMBER(wxLC_NO_HEADER)
97wxFLAGS_MEMBER(wxLC_SINGLE_SEL)
98wxFLAGS_MEMBER(wxLC_SORT_ASCENDING)
99wxFLAGS_MEMBER(wxLC_SORT_DESCENDING)
100wxFLAGS_MEMBER(wxLC_VIRTUAL)
101wxEND_FLAGS( wxListCtrlStyle )
102
103#if ((!defined(__WXMSW__) && !(defined(__WXMAC__) && wxOSX_USE_CARBON)) || defined(__WXUNIVERSAL__))
104wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxListCtrl, wxGenericListCtrl, "wx/listctrl.h")
105#else
106wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxListCtrl, wxControl, "wx/listctrl.h")
107#endif
108
109wxBEGIN_PROPERTIES_TABLE(wxListCtrl)
110wxEVENT_PROPERTY( TextUpdated, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEvent )
111
112wxPROPERTY_FLAGS( WindowStyle, wxListCtrlStyle, long, SetWindowStyleFlag, \
113 GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \
114 wxT("Helpstring"), wxT("group")) // style
115wxEND_PROPERTIES_TABLE()
116
117wxEMPTY_HANDLERS_TABLE(wxListCtrl)
118
119wxCONSTRUCTOR_5( wxListCtrl, wxWindow*, Parent, wxWindowID, Id, \
120 wxPoint, Position, wxSize, Size, long, WindowStyle )
121
122/*
123 TODO : Expose more information of a list's layout etc. via appropriate objects
124 (see NotebookPageInfo)
125 */
126
127IMPLEMENT_DYNAMIC_CLASS(wxListView, wxListCtrl)
128IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
129IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxNotifyEvent)
130
131#endif // wxUSE_LISTCTRL