[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
Re: [XaraXtreme-dev] New Ruler functions
- From: Phil Martin <phil@xxxxxxxx>
- Date: Fri, 30 Jun 2006 12:01:27 +0100
- Subject: Re: [XaraXtreme-dev] New Ruler functions
Here's what I'm thinking about generalising tools access to the
rulers. The idea of claiming the ruler is basically right but it
would involve the creation of new data structures and there'd be the
danger of them getting out of step with tools as tools are switched
in and out. 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.
In other words, we would create a new virtual function in the Tool
class with this prototype:
virtual BOOL OnRulerClick(DocCoord, ClickType, ClickModifiers,
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
Does that sound OK?
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.
On 29 Jun 2006, at 14:25, Martin Wuerthner wrote:
In message <8CC7991A-D556-453B-AA43-E9C6F9F51AF7@xxxxxxxx>
Phil Martin <phil@xxxxxxxx> wrote:
On 29 Jun 2006, at 12:48, Martin Wuerthner wrote:
Not really. I have just finished all the formatting code to
four tab types and added native saving/loading for tabs, so your
work came just in time, very good.
Great. I'll be interested to hear how you're saving the tab info.
A tab (as found in text, not to be confused with a tab stop as found
on a ruler) is just a new kind of abstract text character, so it is
saved very much like an EOL character, just with a different tag (see
the attached diffs for the tag definition).
I will soon submit the text changes for tabbing support. Even without
the user interface to set tab stops it will already be useful. The
ruler attribute is not saved at the moment, but since the default
ruler is empty anyway, it does not matter. You can still use tabs
because there are implicit left align tabs at multiples of 0.5 in
beyond the last user defined tab.