[kde-edu]: KPlotWidget ideas

Inge Wallin inge at lysator.liu.se
Mon Jun 20 14:05:36 CEST 2005

On Monday 20 June 2005 05.42, Jason Harris wrote:
> Hello,
> 1) I'd like to rename some functions in KPlotAxis to make it clearer
> what they do.  The functions that deal with tickmark labels are named
> with "label", which is a bit confusing, because label() and setLabel()
> refer to the *axis* label, not the tick labels.  I'd like to change to
> "tick" in the following functions:
> labelFieldWidth() --> tickFieldWidth()
> setLabelFormat() --> setTickFormat()
> labelFmt() --> tickFormat()
> labelPrec() --> tickPrecision()
> ...or maybe "tickLabel" instead of "tick"?  too wordy?

The general change is good.  I don't have an opinion about the tickLabel one.

> 2) Should we add RightAxis and TopAxis, which can be independent of
> BottomAxis and LeftAxis?  I already use this in my subclass
> (KStarsPlotWidget), but one could argue that we don't need this in the
> base class.

I think it is a good idea.

> 3) Control over whether to show axes, tickmarks, and tick labels should
> be moved to KPlotAxis, so that it can be controlled separately for each
> axis.  Maybe still have some convenience functions in KPlotWidget to
> control both axes at once.  Maybe instead of using DataRect in
> KPlotWidget, we should keep the limits in KPlotAxis as well
> (KPlotAxis::min() and max()).

Good ideas, all of them.

> I don't want to make the class too complicated, but I'd like it to be
> flexible.  I think the best strategy is to focus on making the base
> widget very easy to use as-is, and try to design it so that it's not too
> hard to subclass to extend functionality.

Flexibility with good defaults is what we would like.


Inge Wallin               | Thus spake the master programmer:               |
                          |      "After three days without programming,     |
inge at lysator.liu.se       |       life becomes meaningless."                |
                          | Geoffrey James: The Tao of Programming.         |

More information about the kde-edu mailing list