r1 - 06 Mar 2006 - 15:58:07 - PhilippeBossutYou are here: OSAF >  Projects Web  >  DevelopmentHome > ApplicationProject > GeekTalks > GeekTalk030606

DnD work in Chandler?"> How should DnD work in Chandler?

Monday, March 6th 2006

Jeffrey (host), Philippe (note taker), Reid (note taker), Alec, John, Jed, Pieter

List of issues:

  • Multiple formats, different behaviors
  • Between sections
  • Within sidebar
  • DnD out of Chandler (to the desktop for instance)
  • DnD multiple items
  • DnD from outside to Chandler
  • post 0.7: stamping behavior drop target

Multiple formats, different behaviors

We can drop items and files, what's the best architecture for that?

Donn implemented a drop target using multiple inheritence to handle dispatch. Jeffrey doesn't like inheritence that much. Should we be continuing doing that?

  • Jeffrey proposes to use a unified drop target class instead of using Mixin. wants to avoid having item and file coexisting:
    • would rather have a more generic drag-and-drop
    • can handle anything
  • A DropTarget is an object linked to a wxWidget. onDrop() is overwritten to handle the conversion from the various types.
  • We have the preferred order of drop formats/types (class, file, ... plain text) in BlockType(DropTarget). wx docs mentions handling this in the docs (John).
  • There are a bunch of other methods (like onHover()) that do other things relevant to DnD.

How does wx handle drag-and-drop?

  • Dragging ics files should add them (as a new collection?)
  • Jeffrey had issue with wx to get the format when it was hovering. Couldn't display for instance relevant icon feedback (to differentiate say jpg from ics) because of that. Issue is that self.GetData() can be called only once! So it can't be used on hover, only on drop... Jeffrey will ask Robin.
  • Should we wrap wx drag-and-drop? (Alec)
  • Katie's seen some interesting DnD demo at Pycon so perhaps there is a way to do it. Ask her.

DnD to the Sidebar

When we drag from the canvas to the sidebar, we can't come back to the sidebar. We need to make sure you can drag back on yourself. It was possible before (John). The current canvas code uses a special drag code as long as it stays in the cancas then it calls wxBeginDragAndDrop() once we get the outside the canvas and then assumes only a vanilla DnD mechanism (Alec). What we should do is use the wxDnD from the beginning and move the canvas DnD from its custom place to a more standard place. John says that we can use SimpleCanvas (or what's in there) for that (supports self-dragging if given the appropriate flags).

DnD between different sections

See previous notes on self-dragging

Dragging for reordering in the Sidebar

  • We need to draw while dragging within the sidebar or table summary view (auto-reordering)
  • onHover() covers this. Jed's code is in there to make that work. Needs to be turned back on.

Dragging out of Chandler to the Desktop

  • Need to go to the import/export code and choose best format.
  • We don't have an infrastructure to map items/kinds to formats.
  • John: there's code example in the wx samples, good place to start for sure. wxWidget C code is a bit better.
  • Checkout the widget project from CVS (ask John for help)
    • we don't have all the wxWidget examples
    • so be sure to check them out from wxWidgets CVS
  • You can drag items from the table view to other places, using John's code (not wx)

DnD multiple items

Multiple selection not handle in a lot of places.

Different items dropped on the same target should do different things

DnD from another app to Chandler

Specifically looked at the 0.7 requirement (DnD email from an email client to Chandler so that we can create an event):
  • Different apps are providing different formats so that makes this challenging not to mentions that it might be different for the same app on different platforms...
  • How does Mac OS differ from Windows when identifying the type of data
    • MacOS used to use 4-char type
    • OS X is moving to something more text-based (mime? reverse domains?)
  • No issue though with email attachment since this falls under the file DnD mechanism
  • Outlook in not using an attachment for events though...
  • We need to limit the list of email clients for 0.7.

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.