On Wed, 2005-02-09 at 09:00 +0100, Georg Baum wrote:
> Martin Vermeer wrote:

...

I checked in the basic patch, as it is very straightforward. We'll have
to think about getStatus.

> >> And getStatus needs to be updated to disable addHLineAbove if the cursor
> >> is in the first row.
> > 
> > How? If I look at getStatus for math_gridinset, I see a lot of stuff
> > commented out. Is this supposed to work at all, and how?
> 
> I don't understand this one:
>                if (v_align_ == '\0') {
>                         flag.enabled(true);
>                         break;
>                 }
> 
> but the rest looks as if it should be reenabled.

Actually I don't really understand the rest either.

> What I meant is something like in MathHullInset: E.g disable add-hline-above
>         if (row == 0 && s == "add-hline-above") {
>                 flag.message(N_("Can't add a hline above the first row"));
>                 flag.enabled(false);
>                 return true;
>         }
> 
> But the problem is that we don't know row here!

Hmmm, actually I think we do. We have cur.row().

If I may summarize what I think it _should_ do:

1) If you want to swap two rows, make sure you're not on the last row.
2) If you want to swap two columns, make sure you're not in the
rightmost column.
3) If you want to delete a horizontal or vertical line, make sure there
is one (or more) in the place (above row, left to column) to delete.
(adding or deleting rows or columns is always possible, so no conditions
there; right?)

Disable if any of these conditions is violated, otherwise enable. All
three require cursor (cur) and rowinfo_/colinfo_ knowledge... but we
have that in getStatus, don't we?

(Item 3 is optional; a silent fail is unelegant, however. Strictly
speaking all three are optional if one accepts silent failure)

Do you agree with this? Do I miss something?

> Georg

- Martin

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to