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

Re: [XaraXtreme-dev] New Ruler functions



In message <7D3011B8-ADF9-41A9-906C-D0836A24F1C2@xxxxxxxx>
          Phil Martin <Phil@xxxxxxxx> wrote:

> I was just thinking about adding new functions to the rulers and It's
> just occurred to me that, since the ruler is a general-purpose item
> available for any tool to use, we should create a general framework
> to pass clicks and rendering between the current tool and the ruler,
> then let the text tool specialise within that framework.

Yes, great idea.

> Just a thought: You're probably way ahead of me.

Not really. I have just finished all the formatting code to handle the 
four tab types and added native saving/loading for tabs, so your ruler 
work came just in time, very good.

Drags on the ruler itself do not seem to do anything yet - is there a 
reason why the code in CCamView::InvokeDragOp remains excluded?

The question is whether we want to allow non-current tools or 
additional Kernel clients to use the ruler or just the current tool. 
In the former case, we could have an abstract ruler client interface 
and the guideline code would be one of its clients. In the latter 
case, we could extend the existing guideline code to call the current 
tool in advance, allowing it to claim click/drag events.

The current tool also needs to be able to change the origin of the 
ruler, so the origin of the horizontal ruler is moved to the 
horizontal position of the text line while the text tool is active and 
the caret is in a text object.

Martin