How does Workbench draw the "rubber band" for drag selections?
I want something similar which draws above all my windows like the WB one, although it doesn't particularly need to be animated.
Ideally I would like to just tell Intuition to draw it and give it the co-ordinates, but I can't see that that is possible?
Rubber banding/bounding box selection
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Rubber banding/bounding box selection
Exactly what WB does I don't know.
In SketchBlock I do it but drawing lines with pattern setup via the gfx.library API and the using complement mode, so you can draw and erase without needing to save any backup bitmap.
Safely drawing over the whole screen might need you to lock and / or copy the screen in someway. Not sure if there is an external method to lock the workbench in the way the workbench does whilst dragging icons drawing the crawling ants etc...
In SketchBlock I do it but drawing lines with pattern setup via the gfx.library API and the using complement mode, so you can draw and erase without needing to save any backup bitmap.
Safely drawing over the whole screen might need you to lock and / or copy the screen in someway. Not sure if there is an external method to lock the workbench in the way the workbench does whilst dragging icons drawing the crawling ants etc...
Re: Rubber banding/bounding box selection
I think that's how I tried to do it originally (a long time ago) and got in a state and gave up. I will try it again.broadblues wrote:Exactly what WB does I don't know.
In SketchBlock I do it but drawing lines with pattern setup via the gfx.library API and the using complement mode, so you can draw and erase without needing to save any backup bitmap.
I thought it might be easier to do something which draws over the entire screen the way WB does, maybe with a transparent layer. I don't actually need to transcend window borders.
It's a shame WB (or, better, Intuition) doesn't expose this sort of functionality, along with the icon dragging visual imagery.
Re: Rubber banding/bounding box selection
Workbench isn't drawing the box on the screen; it's drawing it on a background window. If you uncheck the menu item Workbench/Backdrop? you will see that you can't draw the box on the screen; only in the window.chris wrote: I think that's how I tried to do it originally (a long time ago) and got in a state and gave up. I will try it again.
I thought it might be easier to do something which draws over the entire screen the way WB does, maybe with a transparent layer. I don't actually need to transcend window borders.
It's a shame WB (or, better, Intuition) doesn't expose this sort of functionality, along with the icon dragging visual imagery.
I found an example in my OS3 developer CD's called freedraw (with source) that let's you draw a non-animated rubberbanding box in a window. There is an older version of the program on Aminet that has the source too.
Dopus5 does the same animated box as Workbench. It looks to me like it might be an animated BOB. The Dopus5 sources are at SourceForge but it could be difficult to track down the correct functions in that massive amount of code (backdrop_drag.c & drag_routines.c ??).
AmigaOne X1000 with 2GB memory - OS4.1 FE
Re: Rubber banding/bounding box selection
That's not entirely true. It is perfectly happy to draw over the screen, you just can't start the drag from the screen (presumably because it needs a window to detect the click events).xenic wrote:Workbench isn't drawing the box on the screen; it's drawing it on a background window. If you uncheck the menu item Workbench/Backdrop? you will see that you can't draw the box on the screen; only in the window.
I'll have a look at those, thanks.I found an example in my OS3 developer CD's called freedraw (with source) that let's you draw a non-animated rubberbanding box in a window. There is an older version of the program on Aminet that has the source too.
Dopus5 does the same animated box as Workbench. It looks to me like it might be an animated BOB. The Dopus5 sources are at SourceForge but it could be difficult to track down the correct functions in that massive amount of code (backdrop_drag.c & drag_routines.c ??).
- salass00
- AmigaOS Core Developer
- Posts: 530
- Joined: Sat Jun 18, 2011 3:12 pm
- Location: Finland
- Contact:
Re: Rubber banding/bounding box selection
@chris
You should read up on the LockScreen() and UnlockScreen() functions in the intuition.library autodoc. They are made specifically for this purpose.
You should read up on the LockScreen() and UnlockScreen() functions in the intuition.library autodoc. They are made specifically for this purpose.