Enable drag events for all widgets #102

Open
jarvisteach opened this Issue Feb 25, 2017 · 7 comments

Comments

Projects
None yet
1 participant
@jarvisteach
Owner

jarvisteach commented Feb 25, 2017

As #100 revealed, drag/over events can only be associated with Labels. It should be possible to associate these events with any of the widgets.

In .configureWidget() where option == drag or option == over need to remove the check for kind == self.LABEL

@jarvisteach jarvisteach modified the milestone: 0.06 Feb 25, 2017

@jarvisteach jarvisteach self-assigned this Feb 25, 2017

jarvisteach added a commit that referenced this issue Mar 21, 2017

Initial work to update over/drag events (#102)
Moved code to separate functions for over/drag event.
Modularised shared code.
Added exception to indicate function only available for Labels.

Also, combined calls to __bindEvent into single elif…
@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Mar 21, 2017

Owner

Over events should be fine to replicate across all widgets.

But, there is an issue with Drag & Drop. When the mouse button is released, it iterates through all the other labels to work out where the mouse is - so that the user can be notified.

Will need to develop an alternative method, so that all widgets are listening for drop events...
As mentioned in #101 , there is an interesting implementation here

Owner

jarvisteach commented Mar 21, 2017

Over events should be fine to replicate across all widgets.

But, there is an issue with Drag & Drop. When the mouse button is released, it iterates through all the other labels to work out where the mouse is - so that the user can be notified.

Will need to develop an alternative method, so that all widgets are listening for drop events...
As mentioned in #101 , there is an interesting implementation here

jarvisteach added a commit that referenced this issue Mar 22, 2017

Switch from exceptions to warnings (#102)
Switched to warnings, to allow testing to complete

jarvisteach added a commit that referenced this issue Apr 11, 2017

@jarvisteach jarvisteach changed the title from Enable drag/over events for all widgets to Enable drag events for all widgets Apr 14, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Apr 14, 2017

Owner

Splitting over events out to separate issue.

Owner

jarvisteach commented Apr 14, 2017

Splitting over events out to separate issue.

@jarvisteach jarvisteach modified the milestones: 0.06, 0.061, 0.07 Apr 14, 2017

jarvisteach added a commit that referenced this issue May 29, 2017

Investigating issue #102
Playing with tkinters dnd
@jarvisteach

This comment has been minimized.

Show comment
Hide comment

jarvisteach added a commit that referenced this issue Jun 2, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jun 2, 2017

Owner

Widgets that should be able to trigger a dragEvent (sources):

  • Label - all text (or selected text)
  • Entry - selected text
  • TextArea - selected text
  • Message - all text (or selected text)
  • Image - URL or data
  • ListBox - selected items
  • OptionBox - selected item
  • SpinBox - selected item
  • DatePicker - displayed date

Any widget can be registered as a dropTarget - the user determines how to handle a drop.

Process:

  • A function is called to register a widget as a dragSource

  • All registerable widgets will provide a default sourceData generator function

  • But, a user-defined function can be used to override this.

  • A function is called to register a widget as a dropTarget

  • This will receive a String, which the function will handle

  • When the mouse is clicked, a drag starts, and the data is registered with a dndMonitor

  • A visual sign will be provided that a drag is happening - preferably a label, containing text.

  • If the mouse is released over a non-drop target, nothing happens.

  • If the mouse is released over a drop-target, the function is called to receive the data

Owner

jarvisteach commented Jun 2, 2017

Widgets that should be able to trigger a dragEvent (sources):

  • Label - all text (or selected text)
  • Entry - selected text
  • TextArea - selected text
  • Message - all text (or selected text)
  • Image - URL or data
  • ListBox - selected items
  • OptionBox - selected item
  • SpinBox - selected item
  • DatePicker - displayed date

Any widget can be registered as a dropTarget - the user determines how to handle a drop.

Process:

  • A function is called to register a widget as a dragSource

  • All registerable widgets will provide a default sourceData generator function

  • But, a user-defined function can be used to override this.

  • A function is called to register a widget as a dropTarget

  • This will receive a String, which the function will handle

  • When the mouse is clicked, a drag starts, and the data is registered with a dndMonitor

  • A visual sign will be provided that a drag is happening - preferably a label, containing text.

  • If the mouse is released over a non-drop target, nothing happens.

  • If the mouse is released over a drop-target, the function is called to receive the data

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jun 2, 2017

Owner

In order to give an animation for DnD, it's necessary to have a Canvas under the mouse. This might be as easy as changing the appWindow object from a Frame to a Canvas.

Owner

jarvisteach commented Jun 2, 2017

In order to give an animation for DnD, it's necessary to have a Canvas under the mouse. This might be as easy as changing the appWindow object from a Frame to a Canvas.

jarvisteach added a commit that referenced this issue Jun 11, 2017

DnD (#101)
Lots of new code, mostly to support Internal DnD (#102)
* New classes for a base canvas (CanvasDnD) to go under all widgets
* Both main window & subWindows now have a CanvasDnD
* New classes for a DraggableWidget & TrashBin widget
* New functions to register internal DnD
* Renaming to ExternalDnD import and wrappers

Implemented new after functions (#180)
* New functions to provide wrappers for after, etc

Fixed issue with containers in containers (#176)
* starting containers now use `getContainer()` instead of accessing
`containerStack` directly

Updated documentation for events & change-log

New test code for DnD
@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jun 11, 2017

Owner
  • Canvas now implemented in both main window and all subWindows.
  • Functions provided to register widgets as internal dragSources & dropTargets
  • New classes: CanvasDnd, DraggableWidget, TrashBin
  • New imports for INTERNAL/EXTERNAL dnd

DnD gives ability to drag widgets or drag data. Should be set as an option.
In order to better drag widgets:

  • will need to implement a widget cloner - to copy font/colours/size/text for draggablewidget
  • will need to be able to re-grid widgets, keeping ID, but changing grid position
    In order to drag content:
  • will drag a simple label, containing content text
Owner

jarvisteach commented Jun 11, 2017

  • Canvas now implemented in both main window and all subWindows.
  • Functions provided to register widgets as internal dragSources & dropTargets
  • New classes: CanvasDnd, DraggableWidget, TrashBin
  • New imports for INTERNAL/EXTERNAL dnd

DnD gives ability to drag widgets or drag data. Should be set as an option.
In order to better drag widgets:

  • will need to implement a widget cloner - to copy font/colours/size/text for draggablewidget
  • will need to be able to re-grid widgets, keeping ID, but changing grid position
    In order to drag content:
  • will drag a simple label, containing content text
@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jun 11, 2017

Owner

This won't be complete for 0.7 release, moving to 0.8

Owner

jarvisteach commented Jun 11, 2017

This won't be complete for 0.7 release, moving to 0.8

@jarvisteach jarvisteach modified the milestones: 0.08, 0.07 Jun 11, 2017

jarvisteach added a commit that referenced this issue Jul 25, 2017

@jarvisteach jarvisteach modified the milestones: 0.09, 0.08 Aug 20, 2017

@jarvisteach jarvisteach modified the milestones: 0.90, 1.0 Dec 10, 2017

@jarvisteach jarvisteach modified the milestones: 1.0, 1.1 Apr 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment