X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ffecfa5aeb540b54914739dbb8603edbbd4c00a0..80a779275ae04443c568dca919adb26cf6f5002c:/src/palmos/listctrl.cpp?ds=sidebyside diff --git a/src/palmos/listctrl.cpp b/src/palmos/listctrl.cpp index ba7bb430fa..5d7bdf5371 100644 --- a/src/palmos/listctrl.cpp +++ b/src/palmos/listctrl.cpp @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// // 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 ///////////////////////////////////////////////////////////////////////////// @@ -17,11 +17,6 @@ // 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" @@ -29,58 +24,19 @@ #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 ) @@ -94,7 +50,7 @@ wxBEGIN_FLAGS( wxListCtrlStyle ) wxFLAGS_MEMBER(wxBORDER_RAISED) wxFLAGS_MEMBER(wxBORDER_STATIC) wxFLAGS_MEMBER(wxBORDER_NONE) - + // old style border flags wxFLAGS_MEMBER(wxSIMPLE_BORDER) wxFLAGS_MEMBER(wxSUNKEN_BORDER) @@ -133,7 +89,7 @@ wxEND_FLAGS( wxListCtrlStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxListCtrl, wxControl,"wx/listctrl.h") wxBEGIN_PROPERTIES_TABLE(wxListCtrl) - wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent ) + 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() @@ -141,7 +97,7 @@ wxEND_PROPERTIES_TABLE() wxBEGIN_HANDLERS_TABLE(wxListCtrl) wxEND_HANDLERS_TABLE() -wxCONSTRUCTOR_5( wxListCtrl , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle ) +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) @@ -182,11 +138,6 @@ bool wxListCtrl::Create(wxWindow *parent, return false; } -WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const -{ - return 0; -} - void wxListCtrl::UpdateStyle() { } @@ -208,17 +159,11 @@ void wxListCtrl::SetSingleStyle(long style, bool add) { } -// 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; @@ -312,6 +257,12 @@ bool wxListCtrl::SetItemImage(long item, int image, int WXUNUSED(selImage)) 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 { @@ -499,7 +450,7 @@ wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass) // End label editing, optionally cancelling the edit bool wxListCtrl::EndEditLabel(bool WXUNUSED(cancel)) { - return FALSE; + return false; } // Ensures this item is visible @@ -522,14 +473,14 @@ long wxListCtrl::FindItem(long start, const wxString& str, bool partial) // 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, @@ -581,7 +532,7 @@ long wxListCtrl::InsertColumn(long col, // dx is interpreted as number of columns) bool wxListCtrl::ScrollList(int dx, int dy) { - return FALSE; + return false; } // Sort items. @@ -622,7 +573,7 @@ int CALLBACK wxInternalDataCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM l bool wxListCtrl::SortItems(wxListCtrlCompare fn, long data) { - return FALSE; + return false; } @@ -631,26 +582,6 @@ bool wxListCtrl::SortItems(wxListCtrlCompare fn, long data) // 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) { @@ -670,6 +601,14 @@ int wxListCtrl::OnGetItemImage(long WXUNUSED(item)) const 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 @@ -697,8 +636,7 @@ static wxListItemInternalData *wxGetInternalData(HWND hwnd, long itemId) return NULL; }; -static -wxListItemInternalData *wxGetInternalData(const wxListCtrl *ctl, long itemId) +static wxListItemInternalData *wxGetInternalData(const wxListCtrl *ctl, long itemId) { return wxGetInternalData(GetHwndOf(ctl), itemId); }; @@ -712,30 +650,4 @@ static void wxDeleteInternalData(wxListCtrl* ctl, long 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 -