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

Re: [XaraXtreme-dev] Ruler extensions

In message <eef7d4474e.martin@xxxxxxxxxxxxxxxxxxx>
          Martin Wuerthner <lists@xxxxxxxxxxxxxxx> wrote:

> In message <44B7CA43.2040302@xxxxxxxx>
>           Phil Martin <phil@xxxxxxxx> wrote:
>> A small technicality: Could we avoid passing the raw click flags to the
>> Kernel Ruler::OnClick function? We should really write an overloaded
>> version of CCamView::HandleDragEvent that takes in the ClickModifiers
>> directly and that would clean up that whole call sequence, with
>> clickmods only being generated once at the top.
> Yes, true. I missed the fact that the nFlags and the ClickModifiers
> contain the same information, so when I saw that InvokeDragOp required
> the nFlags I passed them through the whole call sequence. It would be
> better to pass back the ClickMods that are passed down anyway.
> Rather than creating a new CCamView method it is probably easier for
> OilRuler::StartToolDrag to convert the ClickMods to nFlags and pass
> them to the standard InvokeDragOp routine as is done for guide drags.

OK, now I see - I cannot just convert from ClickMods to the 
synthesized flags as I proposed above, but fortunately, it is possible 
to convert the other way round, which is actually done in 
CCamView::HandleDragEvent, so the conversion can be done in OilRuler, 
which then passes ClickMods instead of flags to an alternative 
implementation of CCamView::InvokeDragOp (which I think is precisely 
what you suggested above, Phil).