[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

Re: [XaraXtreme-dev] New Ruler functions




On 30 Jun 2006, at 15:08, Martin Wuerthner wrote:

In message <E475F2B1-4983-418B-8192-E5E9434606D5@xxxxxxxx>
          Phil Martin <phil@xxxxxxxx> wrote:

So I'm thinking about a simpler idea, with no new stored
state, that would let the current tool claim individual ruler mouse
events if it uses them. The current tool could choose to claim all,
some or no ruler mouse events. If the current tool doesn't claim a
ruler mouse event then that event will be sent on to the guideline code.

Yes, that is exactly what I had in mind, too.

In other words, we would create a new virtual function in the Tool
class with this prototype:
virtual BOOL OnRulerClick(DocCoord, ClickType, ClickModifiers,
Spread*);

It means that OILRuler and/or Ruler will have a similar set of
routines for converting mouse events into OnRulerClick calls as
CCamView and DocView have for OnClick which is a bit tedious, but not
a problem.

Does that sound OK?

Yes.

Great. (I've already started working on it...)


Regarding rendering new markers on the ruler: The OILRuler classes
will either have to implement new functions to draw specific markers
and make those functions available to the Kernel code or they could
make more general drawing functions available to the Kernel and let
the tool use them to draw different types of marker. I guess the
former is more straightforward but this is up to you really.

It might be easiest to use bitmap markers, then we only need a single
routine to plot a given bitmap at a given ruler position and the
markers can be changed easily.


Good point.

Phil