|
|
Regarding how I passed the event:
''''''''''''''''''''''''' int QuickAccessItem::handle(int event) {
if (event == FL_PUSH) { startDragging_ = true; DraggableItem::instance()->position(window()->x_root() + x(), window()->y_root() + y()); DraggableItem::instance()->setImage(imagePath_); DraggableItem::instance()->handle(FL_PUSH); DraggableItem::instance()->show();
// we need to return used in order to display the window above the current // otherwise it will display it under return 1; }
if (startDragging_) { // now pass the the handle and declare that it is not our business anymore startDragging_ = false; DraggableItem::instance()->handle(event); return 0; }
return Fl_Box::handle(event); } '''''''''''''''''''''
On Thursday, September 10, 2020 at 12:35:39 PM UTC+3 Catalin Poida wrote:
Hi,
I want to make an item
draggable
between windows.
What I am trying to make is to be able to click&drag an item from one window/TL_Window to another.
So far, I could only think about creating a window with shape and the image of the item and pass the event to it when the item is clicked. But still encountered a few problems: - using an png image with transparent background, how can apply the shape accordingly? - cannot pass correctly the event of PUSH and DRAG. If I scale the
draggable item to 100x100 it works, but if I scale it to 40x40, it doesn't work (need an additional click on the draggable item). I am wondering if I did something wrong or I forgot something
Was there an easier solution for creating a draggable item between windows? If not, are there any easy solutions to those problems?
Thank you, Catatlin
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/3c71e156-874a-4d36-a4bf-7bbf90a62e42n%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |