/////////////////////////////////////////////////////////////////////////////
// Name: src/palmos/listctrl.cpp
// Purpose: wxListCtrl
-// Author: William Osborne
+// Author: William Osborne - minimal working wxPalmOS port
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id$
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "listctrl.h"
- #pragma implementation "listctrlbase.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#pragma hdrstop
#endif
-#if wxUSE_LISTCTRL && defined(__WIN95__)
+#if wxUSE_LISTCTRL
#ifndef WX_PRECOMP
#include "wx/app.h"
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/settings.h"
+ #include "wx/dcclient.h"
+ #include "wx/textctrl.h"
#endif
-#include "wx/textctrl.h"
#include "wx/imaglist.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
-// ----------------------------------------------------------------------------
-
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_DRAG)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_RDRAG)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_END_LABEL_EDIT)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ITEM)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_GET_INFO)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_SET_INFO)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_SELECTED)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_DESELECTED)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_KEY_DOWN)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_INSERT_ITEM)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_CLICK)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_RIGHT_CLICK)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_DRAGGING)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_END_DRAG)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_ACTIVATED)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_FOCUSED)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_CACHE_HINT)
-
-#if wxUSE_EXTENDED_RTTI
-WX_DEFINE_FLAGS( wxListCtrlStyle )
-
-wxBEGIN_FLAGS( wxListCtrlStyle )
- // new style border flags, we put them first to
- // use them for streaming out
- wxFLAGS_MEMBER(wxBORDER_SIMPLE)
- wxFLAGS_MEMBER(wxBORDER_SUNKEN)
- wxFLAGS_MEMBER(wxBORDER_DOUBLE)
- wxFLAGS_MEMBER(wxBORDER_RAISED)
- wxFLAGS_MEMBER(wxBORDER_STATIC)
- wxFLAGS_MEMBER(wxBORDER_NONE)
-
- // old style border flags
- wxFLAGS_MEMBER(wxSIMPLE_BORDER)
- wxFLAGS_MEMBER(wxSUNKEN_BORDER)
- wxFLAGS_MEMBER(wxDOUBLE_BORDER)
- wxFLAGS_MEMBER(wxRAISED_BORDER)
- wxFLAGS_MEMBER(wxSTATIC_BORDER)
- wxFLAGS_MEMBER(wxBORDER)
-
- // standard window styles
- wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
- wxFLAGS_MEMBER(wxCLIP_CHILDREN)
- wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
- wxFLAGS_MEMBER(wxWANTS_CHARS)
- wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
- wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
- wxFLAGS_MEMBER(wxVSCROLL)
- wxFLAGS_MEMBER(wxHSCROLL)
-
- wxFLAGS_MEMBER(wxLC_LIST)
- wxFLAGS_MEMBER(wxLC_REPORT)
- wxFLAGS_MEMBER(wxLC_ICON)
- wxFLAGS_MEMBER(wxLC_SMALL_ICON)
- wxFLAGS_MEMBER(wxLC_ALIGN_TOP)
- wxFLAGS_MEMBER(wxLC_ALIGN_LEFT)
- wxFLAGS_MEMBER(wxLC_AUTOARRANGE)
- wxFLAGS_MEMBER(wxLC_USER_TEXT)
- wxFLAGS_MEMBER(wxLC_EDIT_LABELS)
- wxFLAGS_MEMBER(wxLC_NO_HEADER)
- wxFLAGS_MEMBER(wxLC_SINGLE_SEL)
- wxFLAGS_MEMBER(wxLC_SORT_ASCENDING)
- wxFLAGS_MEMBER(wxLC_SORT_DESCENDING)
- wxFLAGS_MEMBER(wxLC_VIRTUAL)
-
-wxEND_FLAGS( wxListCtrlStyle )
-
-IMPLEMENT_DYNAMIC_CLASS_XTI(wxListCtrl, wxControl,"wx/listctrl.h")
-
-wxBEGIN_PROPERTIES_TABLE(wxListCtrl)
- wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent )
-
- wxPROPERTY_FLAGS( WindowStyle , wxListCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
-wxEND_PROPERTIES_TABLE()
-
-wxBEGIN_HANDLERS_TABLE(wxListCtrl)
-wxEND_HANDLERS_TABLE()
-
-wxCONSTRUCTOR_5( wxListCtrl , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
-
-/*
- TODO : Expose more information of a list's layout etc. via appropriate objects (à la NotebookPageInfo)
-*/
-#else
-IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl)
-#endif
-
-IMPLEMENT_DYNAMIC_CLASS(wxListView, wxListCtrl)
-IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
-
-IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxNotifyEvent)
BEGIN_EVENT_TABLE(wxListCtrl, wxControl)
EVT_PAINT(wxListCtrl::OnPaint)
return false;
}
-WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
-{
- return 0;
-}
-
void wxListCtrl::UpdateStyle()
{
}
{
}
-// Set the whole window style
-void wxListCtrl::SetWindowStyleFlag(long flag)
-{
-}
-
// ----------------------------------------------------------------------------
// accessors
// ----------------------------------------------------------------------------
-/* static */ wxVisualAttributes
-wxListCtrl::GetClassDefaultAttributes(wxWindowVariant variant)
+/* static */ wxVisualAttributes wxListCtrl::GetClassDefaultAttributes(wxWindowVariant variant)
{
wxVisualAttributes attrs;
return false;
}
+// Sets the item image
+bool wxListCtrl::SetItemColumnImage(long item, long column, int image)
+{
+ return false;
+}
+
// Gets the item text
wxString wxListCtrl::GetItemText(long item) const
{
}
// Sets the item data
-bool wxListCtrl::SetItemData(long item, long data)
+bool wxListCtrl::SetItemPtrData(long item, wxUIntPtr data)
{
return false;
}
// End label editing, optionally cancelling the edit
bool wxListCtrl::EndEditLabel(bool WXUNUSED(cancel))
{
- return FALSE;
+ return false;
}
// Ensures this item is visible
// in a wxListItemInternalData structure refernced by the actual lParam
long wxListCtrl::FindItem(long start, long data)
{
- return -1;
+ return wxNOT_FOUND;
}
// Find an item nearest this position in the specified direction, starting from
// the item after 'start' or the beginning if 'start' is -1.
long wxListCtrl::FindItem(long start, const wxPoint& pt, int direction)
{
- return -1;
+ return wxNOT_FOUND;
}
// Determines which item (if any) is at the specified point,
// dx is interpreted as number of columns)
bool wxListCtrl::ScrollList(int dx, int dy)
{
- return FALSE;
+ return false;
}
// Sort items.
bool wxListCtrl::SortItems(wxListCtrlCompare fn, long data)
{
- return FALSE;
+ return false;
}
// message processing
// ----------------------------------------------------------------------------
-bool wxListCtrl::MSWCommand(WXUINT cmd, WXWORD id)
-{
- return false;
-}
-
-bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
-{
- return false;
-}
-
-// 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 -1;
}
+int wxListCtrl::OnGetItemColumnImage(long item, long column) const
+{
+ if (!column)
+ return OnGetItemImage(item);
+
+ return -1;
+}
+
wxListItemAttr *wxListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const
{
// no attributes by default
return NULL;
};
-static
-wxListItemInternalData *wxGetInternalData(const wxListCtrl *ctl, long itemId)
+static wxListItemInternalData *wxGetInternalData(const wxListCtrl *ctl, long itemId)
{
return wxGetInternalData(GetHwndOf(ctl), itemId);
};
{
}
-// ----------------------------------------------------------------------------
-// wxWin <-> MSW items conversions
-// ----------------------------------------------------------------------------
-
-static void wxConvertFromMSWListItem(HWND hwndListCtrl,
- wxListItem& info,
- LV_ITEM& lvItem)
-{
-}
-
-static void wxConvertToMSWFlags(long state, long stateMask, LV_ITEM& lvItem)
-{
-}
-
-static void wxConvertToMSWListItem(const wxListCtrl *ctrl,
- const wxListItem& info,
- LV_ITEM& lvItem)
-{
-}
-
-static void wxConvertToMSWListCol(int WXUNUSED(col), const wxListItem& item,
- LV_COLUMN& lvCol)
-{
-}
-
#endif // wxUSE_LISTCTRL
-