Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] pushing SWT's display/interaction capabilities?

Hi,

I'm not an SWT committer or something, but here are some of my thoughts:

1. Can mouse events be passed to a composite not being shown on the screen?
(i.e., a large composite stored within a smaller composite; most of the
larger composite is not visible on the screen but contains components)

From your description I believe that you want to feed native events to the native widgets, not simply SWT events. As far as I know you are unlikely to find this capability in SWT (though maybe they have a half-cooked patch somewhere), but it should be easy to implement for every given platform. Do you mind writing and maintaining some natives?

I believe if you keep the widgets offscreen and feed them native mouse events (e.g. messages on Windows), things should go smoothly.
 
3. Can shape and perspective transforms be applied to Composites, Controls,
or Canvases? (i.e., make a Button look like a triangle going into the
screen.) I think the answer is, "no, buddy, don't you understand that SWT
uses native widgets and most platforms don't allow arbitrary
transformations."  But if I'm wrong here, that would save a ton of trouble.

I have a code for a perspective transform in pure Java. If you want that please email me privately. But basically, you create a Button (or whatever), call paint() to snapshot it (a new method in Eclipse 3.4), apply any transforms and then draw it.

But please note that some platforms use animated controls (e.g. a pulsating button on a Mac), so if you want to transform those, you might need to do the snapshot-transform-draw cycle in a loop, eating up the CPU :)

--
Andrey.


Back to the top