diff --git a/wxPython/demo/CustomDragAndDrop.py b/wxPython/demo/CustomDragAndDrop.py index 46c3ed5240..b93bceb96c 100644 --- a/wxPython/demo/CustomDragAndDrop.py +++ b/wxPython/demo/CustomDragAndDrop.py @@ -124,7 +124,8 @@ class DoodleDropTarget(wxPyDropTarget): self.dv = window # specify the type of data we will accept - self.data = wxCustomDataObject(wxCustomDataFormat("DoodleLines")) + self.df = wxCustomDataFormat("DoodleLines") + self.data = wxCustomDataObject(self.df) self.SetDataObject(self.data) @@ -326,21 +327,20 @@ if __name__ == '__main__': #---------------------------------------------------------------------- +overview = """ +This demo shows Drag and Drop using a custom data type and a custom +data object. A type called "DoodleLines" is created and a Python +Pickle of a list is actually transfered in the drag and drop +opperation. +A second data object is also created containing a bitmap of the image +and is made available to any drop target that accepts bitmaps, such as +MS Word. - - - - - - - - -overview = """\ -This demo shows Drag and Drop using a custom data type and a custom data object. A type called "DoodleLines" is created and a Python Pickle of a list is actually transfered in the drag and drop opperation. - -A second data object is also created containing a bitmap of the image and is made available to any drop target that accepts bitmaps, such as MS Word. - -The two data objects are combined in a wxDataObjectComposite and the rest is handled by the framework. +The two data objects are combined in a wxDataObjectComposite and the +rest is handled by the framework. + """ + + diff --git a/wxPython/demo/wxListBox.py b/wxPython/demo/wxListBox.py index c6499d80e2..d7a67b00c2 100644 --- a/wxPython/demo/wxListBox.py +++ b/wxPython/demo/wxListBox.py @@ -10,10 +10,12 @@ class wxFindPrefixListBox(wxListBox): choices=[], style=0, validator=wxDefaultValidator): wxListBox.__init__(self, parent, id, pos, size, choices, style, validator) self.typedText = '' - EVT_KEY_UP(self, self.OnKey) + self.log = parent.log + EVT_KEY_DOWN(self, self.OnKey) def FindPrefix(self, prefix): + self.log.WriteText('Looking for prefix: %s\n' % prefix) if prefix: prefix = string.lower(prefix) length = len(prefix) @@ -21,7 +23,9 @@ class wxFindPrefixListBox(wxListBox): text = self.GetString(x) text = string.lower(text) if text[:length] == prefix: + self.log.WriteText('Prefix %s is found.\n' % prefix) return x + self.log.WriteText('Prefix %s is not found.\n' % prefix) return -1 @@ -43,8 +47,12 @@ class wxFindPrefixListBox(wxListBox): self.SetSelection(item) else: + self.typedText = '' evt.Skip() + def OnKeyDown(self, evt): + pass + #--------------------------------------------------------------------------- diff --git a/wxPython/demo/wxListCtrl.py b/wxPython/demo/wxListCtrl.py index e64a5256bb..683fdc56aa 100644 --- a/wxPython/demo/wxListCtrl.py +++ b/wxPython/demo/wxListCtrl.py @@ -213,10 +213,11 @@ class TestListCtrlPanel(wxPanel, wxColumnSorterMixin): # this does self.list.SetItemState(10, 0, wxLIST_STATE_SELECTED) - # Show how to reselect something we don't want deselected def OnItemDeselected(self, evt): item = evt.GetItem() - print evt.m_itemIndex + self.log.WriteText("OnItemDeselected: %d" % evt.m_itemIndex) + + # Show how to reselect something we don't want deselected if evt.m_itemIndex == 11: wxCallAfter(self.list.SetItemState, 11, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED) diff --git a/wxPython/demo/wxTreeCtrl.py b/wxPython/demo/wxTreeCtrl.py index ed5adc05e6..707a345fc3 100644 --- a/wxPython/demo/wxTreeCtrl.py +++ b/wxPython/demo/wxTreeCtrl.py @@ -30,7 +30,9 @@ class TestTreeCtrlPanel(wxPanel): tID = NewId() self.tree = MyTreeCtrl(self, tID, wxDefaultPosition, wxDefaultSize, - wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS# | wxTR_MULTIPLE + wxTR_HAS_BUTTONS + | wxTR_EDIT_LABELS + #| wxTR_MULTIPLE #| wxTR_HIDE_ROOT , self.log)