Please help to draw under transparent wx.DragImage - Basket ListView control [src code attached]

Hi all,

The BasketListView control I'm constructing is a ListView descendant
with movable items. You can see something similar in Windows Media
Player: list of files at right part, or in other programs.
Try to run it (sample is attached). And also the screenshot

And now the bugs I can't solve:
1) main bug: the line-bar under the transparent wx.DragImage is got
somehow erased by that image --see attached screenshot
code is in: OnMotion(self, evt):
        self.drawBarLine(dc, index) # draw new bar-line: - #line 332
        ...
      self.dragImage.Move(evt.GetPosition())
      self.dragImage.Show()

2) font for movable transparent item is somehow get *BOLD* (strange thing, too)
and number of other smaller bugs.

Any help is appreciated!

Best regards,
Minas Abrahamyan

scrshot_s1.png

Basket_ListView_sample.py (13.8 KB)

Hi all,

The BasketListView control I'm constructing is a ListView descendant
with movable items.

Have you seen the EditableListBox class? It doesn't support DnD but you might thing it is good enough, at least to start with.

You can see something similar in Windows Media
Player: list of files at right part, or in other programs.
Try to run it (sample is attached). And also the screenshot

And now the bugs I can't solve:
1) main bug: the line-bar under the transparent wx.DragImage is got
somehow erased by that image --see attached screenshot
code is in: OnMotion(self, evt):
        self.drawBarLine(dc, index) # draw new bar-line: - #line 332
        ...
      self.dragImage.Move(evt.GetPosition())
      self.dragImage.Show()

I'm getting a bunch of assertion errors while dragging, perhaps the drawing artifacts are because of those exceptions being raised before the code has finished drawing or redrawing something? Sorry but I don't have time to diagnose this any further than that guess.

2) font for movable transparent item is somehow get *BOLD* (strange thing, too)
and number of other smaller bugs.

That is simply how the CreateByListItem method works. Usually an unbolded font tends to get lost in the cluttered areas of a screen that it may be moving across, so making it bold instead helps the user to keep an eye on it.

···

On 10/18/12 7:05 PM, Minas Abrahamyan wrote:

--
Robin Dunn
Software Craftsman