[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: Please Help: Detecting swt-composite via mouse-event

Snippet46 was intended as an example of how a Visual Editor might allow the 
user to move widgets around to place and resize them.  In a Visual Editor, 
you just want to drag the widget around, you do not need the widget to 
actually act like a widget - that is, within the Visual Editor, you do not 
need to click on the Button you are position and have an action happen, you 
just need it draw accurately.

As Emil suggested, I think you should just use the Canvas to draw the 
Calendar background and manage the moving and resizing of appointments by 
attaching listeners to the individual widgets.  You could also consider 
using Tracker for moving and resizing appointments.  See:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet23.java?rev=HEAD&content-type=text/vnd.viewcvs-markup
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet31.java?rev=HEAD&content-type=text/vnd.viewcvs-markup

"Boris Munivrana" <bmunivrana@xxxxxx> wrote in message 
news:131402eac091f489d065ee3d60d14bbc$1@xxxxxxxxxxxxxxxxxx
>
> Hi Veronika,
>
>> Setting the canvas to not be enabled is a bad idea.  Why are you doing 
>> this? What is the problem you are working around?
>
> I based my code around Snippet 64 "intercept mouse events (drag a button 
> with the mouse)", where the moveable composite's enabled()-property is set 
> to "false" and where the mouselisteners are also registered at the 
> parent-container of the composite (in the snippet's case, the shell 
> itself).
>
> All I have to accomplish is writing a calendar/scheduler which can also be 
> found in MS Outlook or Novell's GroupWise.
> These UI's, as you know, usually are displaying appointments according to 
> a visualized timeline, while allowing the user to modify dates/times via 
> drag % drop and resizing the appointments (usually displayed as 
> rectangles).
>
> So my idea was drawing a calendar like structure onto a canvas, and 
> painting the appointments/rectangles at the specified coordinates which 
> are based on dates/times, while giving them the ability to be 
> moved/modified by mouse events.
>
> Any help is appreciated deeply
>
> Thanks
>
> Boris
>
>
>
>
>