;ň BqĚCc@s­dkZdkZdkiiiZdkZhddddf<ddddf<dd d df<d d d df<ddddf<ddddf<ddddf<ddddf<ddddf<ddd df<d!d"d#df<d$d%d&df<d'd(d)df<d*d+d,df<d-d.d/df<d0d1d2df<d3d4d5df<d6d7d8df<d9d7d:df<d;d7d<df<d=d7d>df<d?d7d@df<dAdBdCdf<dDdBdEdf<dFdBdGdf<dHdBdIdf<dJdBdKdf<dLdBdMdf<dNdBdOdf<dPdBdQdf<dRdBdSdf<dTdUdVdWf<dXdUdYdWf<dZdUd[dWf<d\dUd]dWf<d^dUd_dWf<d`dUdadWf<dbdcdddf<dedcdfdf<dgdhdidjf<dkdhdldjf<dmdhdndjf<dodpdqdjf<drdpdsdjf<dtdpdudjf<dvdwdxdWf<dydzd{dWf<d|d}d~djf<dd}d€djf<dd}d‚djf<dƒd„d…djf<d†d„d‡djf<dˆd„d‰djf<dŠd„d‹djfswxsPanels__init__sselfsparents WANTS_CHARSslogsNewIdstIDs ImageListsilsAddsimagessgetSmilesBitmapsidx1sgetSmallUpArrowBitmapssm_upsgetSmallDnArrowBitmapssm_dns TestListCtrls LC_REPORTs BORDER_NONEsLC_EDIT_LABELSsLC_SORT_ASCENDINGslists SetImageListsIMAGE_LIST_SMALLs PopulateLists musicdatas itemDataMapslistmixsColumnSorterMixinsBindsEVT_SIZEsOnSizesEVT_LIST_ITEM_SELECTEDsOnItemSelectedsEVT_LIST_ITEM_DESELECTEDsOnItemDeselectedsEVT_LIST_ITEM_ACTIVATEDsOnItemActivatedsEVT_LIST_DELETE_ITEMs OnItemDeletesEVT_LIST_COL_CLICKs OnColClicksEVT_LIST_COL_RIGHT_CLICKsOnColRightClicksEVT_LIST_COL_BEGIN_DRAGsOnColBeginDragsEVT_LIST_COL_DRAGGINGs OnColDraggingsEVT_LIST_COL_END_DRAGs OnColEndDragsEVT_LIST_BEGIN_LABEL_EDITs OnBeginEditsEVT_LEFT_DCLICKs OnDoubleClicksEVT_RIGHT_DOWNs OnRightDownsEVT_COMMAND_RIGHT_CLICKs OnRightClicks EVT_RIGHT_UP(sselfsparentslogstID((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys__init__Xs8   '   cCsůtiƒ}titiBtiB|_d|_d|_d|_ |i i d|ƒti |_d|_ |i i d|ƒd|_d|_ |i i d|ƒtiƒ}x}|D]u\}}|i iti|d|iƒ}|i i|d|dƒ|i i|d|dƒ|i i||ƒq´W|i idtiƒ|i idtiƒ|i iddƒ|i id titiƒ|i idƒ}|iti ƒ|i i!|ƒ|i id ƒ}|iti"ƒ|i i!|ƒd|_#dS( Ni˙˙˙˙isArtistsTitleisGenreiidii($swxsListItemsinfosLIST_MASK_TEXTsLIST_MASK_IMAGEsLIST_MASK_FORMATsm_masksm_imagesm_formatsm_textsselfslistsInsertColumnInfosLIST_FORMAT_RIGHTs musicdatasitemsskeysdatasInsertImageStringItemssyssmaxintsidx1sindexs SetStringItems SetItemDatasSetColumnWidths LIST_AUTOSIZEs SetItemStatesLIST_STATE_SELECTEDsGetItemsitems SetTextColoursBLUEsSetItemsREDs currentItem(sselfsinfosindexsitemssitemskeysdata((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys PopulateList‘s>          "cCs |iSdS(N(sselfslist(sself((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys GetListCtrlÂscCs|i|ifSdS(N(sselfssm_dnssm_up(sself((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys GetSortImagesĆscCs†|iƒ}|iƒ}|iidt||fƒƒ|i i ||fƒ\}}|t i@o|i i|ƒn|iƒdS(Ns x, y = %s (seventsGetXsxsGetYsysselfslogs WriteTextsstrslistsHitTestsitemsflagsswxsLIST_HITTEST_ONITEMsSelectsSkip(sselfseventsitemsflagssysx((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnRightDownĘs   cCs#|ii||ƒ}|iƒSdS(N(sselfslistsGetItemsindexscolsitemsGetText(sselfsindexscolsitem((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys getColumnTextÖscCs§|i|_|iid|i|ii|iƒ|i|idƒ|i|idƒfƒ|idjo-|iidƒ|ii ddt i ƒn|i ƒdS(NsOnItemSelected: %s, %s, %s, %s iii s!OnItemSelected: Veto'd selection i( sevents m_itemIndexsselfs currentItemslogs WriteTextslists GetItemTexts getColumnTexts SetItemStateswxsLIST_STATE_SELECTEDsSkip(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pysOnItemSelectedŰs  PcCs]|iƒ}|iid|iƒ|idjo&ti|i i dti ti ƒndS(NsOnItemDeselected: %di ( sevtsGetItemsitemsselfslogs WriteTexts m_itemIndexswxs CallAfterslists SetItemStatesLIST_STATE_SELECTED(sselfsevtsitem((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pysOnItemDeselectedís cCsB|i|_|iid|ii|iƒ|iiƒfƒdS(NsOnItemActivated: %s TopItem: %s( sevents m_itemIndexsselfs currentItemslogs WriteTextslists GetItemTexts GetTopItem(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pysOnItemActivatedös cCs|iidƒ|iƒdS(Ns OnBeginEdit(sselfslogs WriteTextseventsAllow(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnBeginEditűscCs|iidƒdS(Ns OnItemDelete (sselfslogs WriteText(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnItemDelete˙scCs(|iid|iƒƒ|iƒdS(NsOnColClick: %d (sselfslogs WriteTextsevents GetColumnsSkip(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnColClickscCs`|ii|iƒƒ}|iid|iƒ|iƒ|iƒ|i ƒ|i ƒffƒdS(NsOnColRightClick: %d %s ( sselfslists GetColumnseventsitemslogs WriteTextsGetTextsGetAlignsGetWidthsGetImage(sselfseventsitem((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pysOnColRightClickscCs|iidƒdS(NsOnColBeginDrag (sselfslogs WriteText(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pysOnColBeginDrag scCs|iidƒdS(NsOnColDragging (sselfslogs WriteText(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnColDraggingscCs|iidƒdS(Ns OnColEndDrag (sselfslogs WriteText(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnColEndDragscCs1|iid|ii|iƒƒ|iƒdS(NsOnDoubleClick item %s (sselfslogs WriteTextslists GetItemTexts currentItemseventsSkip(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnDoubleClicks#cCsĺ|iid|ii|iƒƒt|dƒ otiƒ|_ tiƒ|_ tiƒ|_ tiƒ|_ tiƒ|_ tiƒ|_|iti|id|i ƒ|iti|id|i ƒ|iti|id|i ƒ|iti|id|i ƒ|iti|id|i ƒ|iti|id|iƒntiƒ}|i|i dƒ|i|i dƒ|i|i dƒ|i|i dƒ|i|i dƒ|i|id ƒ|i|ƒ|iƒdS( NsOnRightClick %s spopupID1sidsFindItem testssIterate SelectedsClearAll and repopulatesDeleteAllItemssGetItemsEdit(sselfslogs WriteTextslists GetItemTexts currentItemshasattrswxsNewIdspopupID1spopupID2spopupID3spopupID4spopupID5spopupID6sBindsEVT_MENUs OnPopupOnes OnPopupTwos OnPopupThrees OnPopupFours OnPopupFives OnPopupSixsMenusmenusAppends PopupMenusDestroy(sselfseventsmenu((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnRightClicks.##  cCsD|iidƒdG|iiddƒGHdG|iiddƒGHdS(Ns Popup one s FindItem:i˙˙˙˙sRoxettes FindItemData:i (sselfslogs WriteTextslistsFindItems FindItemData(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnPopupOne@scCs||iidƒ|iiƒ}xV|djoH|iid|ii|ƒ|i|dƒfƒ|ii|ƒ}q"WdS(NsSelected items: i˙˙˙˙s %s: %s i( sselfslogs WriteTextslistsGetFirstSelectedsindexs GetItemTexts getColumnTextsGetNextSelected(sselfseventsindex((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnPopupTwoEs  2cCs1|iidƒ|iiƒti|iƒdS(Ns Popup three (sselfslogs WriteTextslistsClearAllswxs CallAfters PopulateList(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnPopupThreeMs cCs|iiƒdS(N(sselfslistsDeleteAllItems(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnPopupFourRscCs;|ii|iƒ}|iG|iG|ii|iƒGHdS(N(sselfslistsGetItems currentItemsitemsm_textsm_itemIds GetItemData(sselfseventsitem((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnPopupFiveUscCs|ii|iƒdS(N(sselfslists EditLabels currentItem(sselfsevent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys OnPopupSixYscCs/|iƒ\}}|iidd||ƒdS(Ni(sselfsGetClientSizeTupleswshslists SetDimensions(sselfseventshsw((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pysOnSize]s(s__name__s __module__s__init__s PopulateLists GetListCtrls GetSortImagess OnRightDowns getColumnTextsOnItemSelectedsOnItemDeselectedsOnItemActivateds OnBeginEdits OnItemDeletes OnColClicksOnColRightClicksOnColBeginDrags OnColDraggings OnColEndDrags OnDoubleClicks OnRightClicks OnPopupOnes OnPopupTwos OnPopupThrees OnPopupFours OnPopupFives OnPopupSixsOnSize(((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pysTestListCtrlPanelWs2 9 1              #      cCst||ƒ}|SdS(N(sTestListCtrlPanelsnbslogswin(sframesnbslogswin((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pysrunTestessů A list control presents lists in a number of formats: list view, report view, icon view and small icon view. In any case, elements are numbered from zero. For all these modes (but not for virtual list controls), the items are stored in the control and must be added to it using InsertItem method.

To intercept events from a list control, use the event table macros described in wxListEvent.

Mix-ins

This example demonstrates how to use mixins. The following mixins are available.

ColumnSorterMixin

ColumnSorterMixin(numColumns)

A mixin class that handles sorting of a wxListCtrl in REPORT mode when the column header is clicked on.

There are a few requirments needed in order for this to work genericly:

  1. The combined class must have a GetListCtrl method that returns the ListCtrl to be sorted, and the list control must exist at the time the ColumnSorterMixin.__init__()method is called because it uses GetListCtrl.
  2. Items in the list control must have a unique data value set with list.SetItemData.
  3. The combined class must have an attribute named itemDataMap that is a dictionary mapping the data values to a sequence of objects representing the values in each column. These valuesare compared in the column sorter to determine sort order.

Interesting methods to override are GetColumnSorter, GetSecondarySortValues, and GetSortImages.

Methods
SetColumnCount(newNumColumns)
Informs the mixin as to the number of columns in the control. When it is set, it also sets up an event handler for EVT_LIST_COL_CLICK events.
SortListItems(col=-1, ascending=1)
Sort the list on demand. Can also be used to set the sort column and order.
GetColumnWidths()
Returns a list of column widths. Can be used to help restore the current view later.
GetSortImages()
Returns a tuple of image list indexes the indexes in the image list for an image to be put on the column header when sorting in descending order
GetColumnSorter()
Returns a callable object to be used for comparing column values when sorting.
GetSecondarySortValues(col, key1, key2)
Returns a tuple of 2 values to use for secondary sort values when the items in the selected column match equal. The default just returns the item data values.

ListCtrlAutoWidthMixin

ListCtrlAutoWidthMixin()

A mix-in class that automatically resizes the last column to take up the remaining width of the ListCtrl.

This causes the ListCtrl to automatically take up the full width of the list, without either a horizontal scroll bar (unless absolutely necessary) or empty space to the right of the last column.

NOTE: This only works for report-style lists.

WARNING: If you override the EVT_SIZE event in your ListCtrl, make sure you call event.Skip() to ensure that the mixin's _OnResize method is called.

This mix-in class was written by Erik Westra

Methods
resizeLastColumn(minWidth)
Resize the last column appropriately. If the list's columns are too wide to fit within the window, we use a horizontal scrollbar. Otherwise, we expand the right-most column to take up the remaining free space in the list. This method is called automatically when the ListCtrl is resized; you can also call it yourself whenever you want the last column to be resized appropriately (eg, when adding, removing or resizing columns). 'minWidth' is the preferred minimum width for the last column.

ListCtrlSelectionManagerMix

ListCtrlSelectionManagerMix()

Mixin that defines a platform independent selection policy

As selection single and multi-select list return the item index or a list of item indexes respectively.

Methods
getPopupMenu()
Override to implement dynamic menus (create)
setPopupMenu(menu)
Must be set for default behaviour.
afterPopupMenu()
Override to implement dynamic menus (destroy).
getSelection()
Returns the current selection (or selections as a Python list if extended selection is enabled) s__main__si(ssysswxswx.lib.mixins.listctrlslibsmixinsslistctrlslistmixsimagess musicdatasListCtrlsListCtrlAutoWidthMixins TestListCtrlsPanelsColumnSorterMixinsTestListCtrlPanelsrunTestsoverviews__name__sossrunsmainspathsbasenamesargv( s musicdatasrunTestsrunsTestListCtrlPanelsoverviews TestListCtrlssyssimagessosslistmixswx((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ListCtrl.pys? s   ˙˙˙Ő;˙ „